From d06ec99f98a5fc090da8e698f8a7965530a428ab Mon Sep 17 00:00:00 2001 From: dafeliton Date: Tue, 20 Feb 2024 17:04:13 -0800 Subject: [PATCH] Rewrite selenium script, scipy test build --- .github/workflows/main.yml | 9 +++--- images/scipy-ml-notebook/Dockerfile | 3 +- scripts/selenium_setup.sh | 44 ++++++++++++++--------------- 3 files changed, 27 insertions(+), 29 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ae248778..cecfeae8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,11 +87,10 @@ jobs: sudo yum remove python3-requests -y python3 -m pip install -r scripts/requirements.txt - # TODO: Re-enable and fix for yum instead of apt - #- name: Install selenium dependecies for r studio - # run: | - # chmod +x ./scripts/selenium_setup.sh - # ./scripts/selenium_setup.sh + - name: Install selenium dependecies for r studio + run: | + chmod +x ./scripts/selenium_setup.sh + ./scripts/selenium_setup.sh - name: Install pydoit fixed run: | diff --git a/images/scipy-ml-notebook/Dockerfile b/images/scipy-ml-notebook/Dockerfile index 9cd683f5..2f48bc91 100644 --- a/images/scipy-ml-notebook/Dockerfile +++ b/images/scipy-ml-notebook/Dockerfile @@ -1,5 +1,5 @@ ARG BASE_TAG=latest -FROM ghcr.io/ucsd-ets/datascience-notebook:2023.4-fix-rstudio-proxy +FROM ghcr.io/ucsd-ets/datascience-notebook:$BASE_TAG USER root @@ -50,7 +50,6 @@ RUN mamba install -c "nvidia/label/cuda-11.8.0" cuda-nvcc \ fix-permissions /home/$NB_USER && \ mamba clean -a -y - #RUN mamba list | egrep '(cuda-version|nvidia/label/cuda)' | awk '{ print $1"=="$2;}' > public/envs/test3/conda-meta/pinned RUN mamba install nccl -c conda-forge -y && \ diff --git a/scripts/selenium_setup.sh b/scripts/selenium_setup.sh index abaa4889..0cc2e697 100644 --- a/scripts/selenium_setup.sh +++ b/scripts/selenium_setup.sh @@ -1,32 +1,32 @@ -#!/bin/bash - -# File google-chrome.list allows `apt update` to fetch the latest stable of Chrome -# OLD: sudo bash -c "echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.90-1_amd64.deb' >> /etc/apt/sources.list.d/google-chrome.list" - -# Prepare chrome repo -wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - - -echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list - -sudo apt -y update - -# Install latest Chrome -sudo apt -y install google-chrome-stable unzip +# Prepare the chrome repo +sudo wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo rpm --import - + +# Configure it +echo "[google-chrome] +name=google-chrome - \$basearch +baseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch +enabled=1 +gpgcheck=1 +gpgkey=https://dl.google.com/linux/linux_signing_key.pub" | sudo tee /etc/yum.repos.d/google-chrome.repo + +# Update pkg list +sudo dnf makecache + +# Install the latest Google Chrome +sudo dnf -y install google-chrome-stable unzip chrome_version=$(grep -iEo "[0-9.]{10,20}" <(google-chrome --version)) echo "The stable Chrome version is: ${chrome_version}" # ISSUE: Chrome driver may not have the same latest version for download # Workaround: fetch the LATEST_RELEASE version available for download -# OLD: driver_version=$(curl -s -L https://chromedriver.storage.googleapis.com/LATEST_RELEASE_114) -# Download latest chrome driver, instead of above methods +# Download the latest Chrome Driver driver_version=$(curl -s -L https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE) echo "Latest Chrome driver version is: ${driver_version}" -# OLD: wget https://chromedriver.storage.googleapis.com/${driver_version}/chromedriver_linux64.zip wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/${driver_version}/linux64/chromedriver-linux64.zip -# install Chrome Driver -unzip chromedriver-linux64.zip -sudo mv chromedriver-linux64/chromedriver /usr/bin/chromedriver -sudo chown root:root /usr/bin/chromedriver -sudo chmod +x /usr/bin/chromedriver +# Install Chrome Driver +unzip chromedriver-linux64.zip +sudo mv chromedriver /usr/local/bin/chromedriver +sudo chown root:root /usr/local/bin/chromedriver +sudo chmod +x /usr/local/bin/chromedriver \ No newline at end of file