From fc3a05d8b884c026c64b75a69aa1a920bf25c6f2 Mon Sep 17 00:00:00 2001 From: Chris Scott Date: Tue, 20 Feb 2024 08:39:14 +1300 Subject: [PATCH] initial commit --- .github/workflows/build_container.yml | 47 +++++++++++++++ LICENSE | 21 +++++++ README.md | 3 + docker/Dockerfile | 47 +++++++++++++++ form.yml | 17 ++++++ icon.png | Bin 0 -> 12760 bytes manifest.yml | 7 +++ submit.yml.erb | 79 ++++++++++++++++++++++++++ template/.keep | 0 template/script.sh.erb | 23 ++++++++ view.html.erb | 7 +++ 11 files changed, 251 insertions(+) create mode 100644 .github/workflows/build_container.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 docker/Dockerfile create mode 100644 form.yml create mode 100644 icon.png create mode 100644 manifest.yml create mode 100644 submit.yml.erb create mode 100644 template/.keep create mode 100755 template/script.sh.erb create mode 100644 view.html.erb diff --git a/.github/workflows/build_container.yml b/.github/workflows/build_container.yml new file mode 100644 index 0000000..9a6d7bf --- /dev/null +++ b/.github/workflows/build_container.yml @@ -0,0 +1,47 @@ +# +name: Create and publish a Docker image + +on: + push: + workflow_dispatch: + +# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. +jobs: + build-and-push-image: + runs-on: ubuntu-latest + # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. + permissions: + contents: read + packages: write + # + steps: + - name: Checkout repository + uses: actions/checkout@v4 + # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. + # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. + # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: docker + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5c48ee2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Ohio Supercomputer Center + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..35d8c56 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# NeSI training environment ML102 Jupyter app + +JupyterLab app for running the ML102 workshop on the NeSI training environment. diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..79ea2b7 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,47 @@ +FROM ubuntu:22.04 + +# install system dependencies +# TODO: move ldap-utils, libnss-ldapd, libpam-ldapd, nscd, nslcd to base image?? +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + curl \ + git \ + ldap-utils \ + libnss-ldapd \ + libpam-ldapd \ + less \ + nano \ + nodejs \ + nscd \ + nslcd \ + python-is-python3 \ + python3 \ + python3-pip \ + rsync \ + unzip \ + vim \ + wget \ + zip \ + && rm -rf /var/lib/apt/lists/* + +# download the required image files into the container image +RUN wget -nv https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz \ + -O /var/lib/flower_photos.tgz \ + && tar -xzf /var/lib/flower_photos.tgz -C /var/lib \ + && rm -f /var/lib/flower_photos.tgz \ + && chown -R root:root /var/lib/flower_photos \ + && chmod -R o+rX /var/lib/flower_photos \ + && wget -nv https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip \ + -O /var/lib/cats_and_dogs_filtered.zip \ + && unzip -q -d /var/lib /var/lib/cats_and_dogs_filtered.zip \ + && rm -f /var/lib/cats_and_dogs_filtered.zip \ + && chown -R root:root /var/lib/cats_and_dogs_filtered \ + && chmod -R o+rX /var/lib/cats_and_dogs_filtered + +# copy the repo source (e.g. notebooks) to the container image and install dependencies +ARG ML102_HASH="49d642bde806e73f9666fda8747a5dacf81bd117" +RUN git clone https://github.com/nesi/ml102_workshop.git /opt/ml102_workshop \ + && cd /opt/ml102_workshop \ + && git checkout $ML102_HASH \ + && pip3 --no-cache-dir install -r requirements.txt \ + && pip3 --no-cache-dir install jupyterlab \ + && rm -rf /opt/ml102_workshop/.git diff --git a/form.yml b/form.yml new file mode 100644 index 0000000..60af4ea --- /dev/null +++ b/form.yml @@ -0,0 +1,17 @@ +--- +cluster: "my-k8s-cluster" + +form: + - cpu + - memory + - wall_time + +attributes: + cpu: 2 + memory: 4 + wall_time: + widget: number_field + label: "Hours" + min: 4 + max: 12 + value: 8 diff --git a/icon.png b/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..480932523cd389416c1b7dfffb8b0580616e9051 GIT binary patch literal 12760 zcmbvQcT`i)7d{FH2oQP)X&QP5rGrS3-X%0?q6iAoLg*mHpmdNLM4E&mMNp{;)u1Sy z41<@zs=(r}WDj`e8_IFXMc46o z<|a}T=wr-p!W8K1fuf&92AhwclI^wggg3c1<{4rruGKDj{X7~RO%-I|0u(}`QM!gM zp|9tNbgwI4mt+rJtgTjc{?(5rjR!$*T>YEmtf71vQD{GS6>)Xbd8Q<*DrDwl?;#xcY3c?a21+aO3ic+Jx!|oypGtcRSs8XI$K1@)XLe;}cFf22|kJ zsk1e$RO8c=if_*-Op+MznB|bu+2*Bjrag|;!PScdHpg}Nz9fZ7^1M%UKzZe2Lr1Cx z9JFJwk+5v`&~kddJE4G0^l8{4>A8|B?&NAK>BMM{!!Z(;z2-Q3%aJ_+<<82E$yH(QQLN~KfDYLLfnksIM`NB zpP#ifF!@Wwz-uIN0}Rdz#>Pzq2x_^Hp#j57WQ+dxJ4ncWmXbC75g?$^1%!P4dGamEpAXl^3`>YR{l@ zCDFx8{U{csp(gzM8A7r-kZaK}z}7E09OJ3QCXY_1?jv&2ga@bRhL%8 zxqe#P0_R`PY~j-a^wUsV_dZrOWN$ek+L6!f5AJSzL3Lv`7{CtHWgu~PAa^1`%?i0QEsuYq=q}={sXFv&g zZgyw+$K;@DlV6!a3@;Hli_5h1c(M}9Iz3)L(YBRf%u68q$k_M6ho@;hmX@B&jM*uQ zIDTLR9lCW|I7813#UNq5nGmn zzG~PruSEJ}C#dhsN}qIg$FN1OPEP*W2M|7y8BY&nK5`w>VB?%T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ONuxF45J?Q-<=2Z-x|>jW06=^)6dW!aIHMawpvQx8 z`ln_;0{*REy@>_vTF~}$Y+fna(-BGl$Ocpcw^Y!x?v4pbs@Lrt0Y=*{6kW-Sk)|@i zHYMg<^VlS+Db?W*WQRum?gbhev!?)Ae-TW>WlL0GSOLXUB;msf`m90?s?8s0XdOw5 z6e}j!w{ovWc(?AIQF9RiBbo8X8nu4<TDJFIQC}+DrzZuWU z3p6u$YV9+BUx0yO*E2>lu|FPqP$U-ddj2IlzeICKW6LZaYqnFYL7z!YKh8hDAh^l4P8oxrQN>+Ic|S@kXT|3n3AI048yx|-Djp7tVxtp8r>d)C~u z%BxgWSpXSppD0GRK1C-Kr&^son?z&F=gvAtEZbB6N_6c6+4HX)6x|b=N2Wg&wzF|wAHb7C;z*`Rjzj4Vnwf_jGLB1uRF*5AUdN1G{?slAMG|# z>Y1kIg8>`ngD&T9tuHE4D&GdGQ|#W6v&jIK4`=rPoG*KcM(yNlN8rTeeH+@RxumZh z!Ng7DzyCelB%rb6D635YD0*yc?h-Mjp0z>)iU)_mDRw#%q?AtoTDbTo8L&U7>1a{7 zcJj9y!Jo=EjJZ=Tu2cAc?Rz>1%L{mJs-72A!RrMjKm@%V$S)+F`sCQnP+K(u$fJW8 zxPCD7Z?48vF{|3@_{(Sa(EuYpmtk+L##P}g7}XpyEo%;71@v6}yiL*J6LI=})o~NH z8M43&>zVtlhg9nR3y^j@lXM~h-qnWDp;OPx(%Z7OAMGxWWeUtul?SX(VOxz`_-QP) oa)*QQ|9~C-U)~}HuGk)f99u}f`2L=}PMd@DwN13D?>|QVUvWB~Z~y=R literal 0 HcmV?d00001 diff --git a/manifest.yml b/manifest.yml new file mode 100644 index 0000000..d79708b --- /dev/null +++ b/manifest.yml @@ -0,0 +1,7 @@ +--- +name: ML102 +category: Interactive Apps +subcategory: Servers +role: batch_connect +description: | + This app will launch a Jupyter Lab server for the ML102 workshop diff --git a/submit.yml.erb b/submit.yml.erb new file mode 100644 index 0000000..9183052 --- /dev/null +++ b/submit.yml.erb @@ -0,0 +1,79 @@ +<% + pwd_cfg = "c.ServerApp.password=u\'sha1:${SALT}:${PASSWORD_SHA1}\'" + host_port_cfg = "c.ServerApp.base_url=\'/node/${HOST_CFG}/${PORT_CFG}/\'" + + configmap_filename = "ondemand_config.py" + configmap_data = "c.NotebookApp.port = 8080" + utility_img = "ghcr.io/nesi/training-environment-k8s-utils:v0.1.0" + + user = OodSupport::User.new + + services_node = Resolv.getaddress("servicesnode") +%> +--- +script: + accounting_id: "<%= account %>" + wall_time: "<%= wall_time.to_i * 3600 %>" + native: + container: + name: "ml102" + image: "ghcr.io/nesi/training-environment-jupyter-ml102-app:v0.1.0" + command: ["/bin/bash","-l","<%= staged_root %>/job_script_content.sh"] + working_dir: "<%= Etc.getpwnam(ENV['USER']).dir %>" + restart_policy: 'OnFailure' + env: + NB_UID: "<%= user.uid %>" + NB_USER: "<%= user.name %>" + NB_GID: "<%= user.group.id %>" + HOME: "<%= user.home %>" + LOG_DIR: "<%= staged_root %>" + SHELL: "/bin/bash" + port: "8080" + cpu: "<%= cpu %>" + memory: "<%= memory %>Gi" + mounts: + - type: nfs + name: home + host: <%= services_node %> + path: /srv/homes + destination_path: /home/shared + - type: host + name: nslcd-socket + host_type: Socket + path: /var/run/nslcd/socket + destination_path: /var/run/nslcd/socket + - type: host + name: nsswitch-conf + host_type: File + path: /etc/nsswitch.conf + destination_path: /etc/nsswitch.conf + configmap: + files: + - filename: "<%= configmap_filename %>" + data: | + c.ServerApp.ip = '0.0.0.0' + c.ServerApp.port = 8080 + c.ServerApp.port_retries = 0 + c.ServerApp.open_browser = False + c.ServerApp.allow_origin = '*' + c.ServerApp.root_dir = '<%= user.home %>/ml102_workshop' + c.ServerApp.disable_check_xsrf = True + mount_path: '/ood' + init_containers: + - name: "init-secret" + image: "<%= utility_img %>" + command: + - "/bin/save_passwd_as_secret" + - "user-<%= user.name %>" + - name: "add-passwd-to-cfg" + image: "<%= utility_img %>" + command: + - "/bin/bash" + - "-c" + - "source /bin/passwd_from_secret; source /bin/create_salt_and_sha1; /bin/add_line_to_configmap \\\"<%= pwd_cfg %>\\\" <%= configmap_filename %>" + - name: "add-hostport-to-cfg" + image: "<%= utility_img %>" + command: + - "/bin/bash" + - "-c" + - "source /bin/find_host_port; /bin/add_line_to_configmap \\\"<%= host_port_cfg %>\\\" <%= configmap_filename %>" diff --git a/template/.keep b/template/.keep new file mode 100644 index 0000000..e69de29 diff --git a/template/script.sh.erb b/template/script.sh.erb new file mode 100755 index 0000000..c5f2e4e --- /dev/null +++ b/template/script.sh.erb @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +exec &> >(tee -a "${LOG_DIR}/pod.log") + +# Benchmark info +echo "TIMING - Starting main script at: $(date)" + +cp /ood/ondemand_config.py ./ + +# Set working directory to home directory +cd "${HOME}" + +# +# Start Jupyter Notebook Server +# + +# Benchmark info +echo "TIMING - Starting jupyter at: $(date)" + +# Launch the Jupyter Notebook Server +set -x +rsync --ignore-existing -avz /opt/ml102_workshop/ ~/ml102_workshop/ +jupyter lab --config="/ood/ondemand_config.py" diff --git a/view.html.erb b/view.html.erb new file mode 100644 index 0000000..b5c7d77 --- /dev/null +++ b/view.html.erb @@ -0,0 +1,7 @@ +
+ + +
+