From 6013fac99fc0548d75a942fd199a0e8fc829354f Mon Sep 17 00:00:00 2001 From: Dinindu Senanayake Date: Wed, 5 Jun 2024 19:37:49 +1200 Subject: [PATCH] update ghcr container version and add .workflows --- .github/workflows/build_container.yml | 50 +++++++++++++++++++++++++++ docker/Dockerfile | 8 ++--- manifest.yml | 4 +-- submit.yml.erb | 4 +-- view.html.erb | 2 +- 5 files changed, 57 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/build_container.yml diff --git a/.github/workflows/build_container.yml b/.github/workflows/build_container.yml new file mode 100644 index 0000000..04833d6 --- /dev/null +++ b/.github/workflows/build_container.yml @@ -0,0 +1,50 @@ +# +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: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry + uses: docker/login-action@v3 + 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@v5 + 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@v5 + with: + context: docker + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + diff --git a/docker/Dockerfile b/docker/Dockerfile index 4704a6e..9dbcbd4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -46,11 +46,7 @@ RUN add-apt-repository -y ppa:apptainer/ppa \ && apt install -y apptainer-suid \ && rm -rf /var/lib/apt/lists/* - - - - - +# install applications via conda RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /miniconda.sh \ && bash /miniconda.sh -b -p /opt/miniconda3 \ && rm -f /miniconda.sh \ @@ -83,5 +79,5 @@ RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh - && echo "conda activate /var/lib/genome-assembly" >> /etc/profile.d/conda.sh - # install jupyterlab +# install jupyterlab RUN pip3 --no-cache-dir install jupyterlab diff --git a/manifest.yml b/manifest.yml index afe4db9..a5ad107 100644 --- a/manifest.yml +++ b/manifest.yml @@ -1,7 +1,7 @@ --- -name: Introduction to Nextflow Workshop +name: Long-read Genome Assembly category: Interactive Apps subcategory: Servers role: batch_connect description: | - This app will launch a Jupyter Lab for the Introduction to Nextflow workshop + This app will launch a Jupyter Lab for the Long-read Genome Assembly workshop diff --git a/submit.yml.erb b/submit.yml.erb index 6fac9ef..3e9c52d 100644 --- a/submit.yml.erb +++ b/submit.yml.erb @@ -16,8 +16,8 @@ script: wall_time: "<%= wall_time.to_i * 3600 %>" native: container: - name: "nextflow" - image: "ghcr.io/nesi/training-environment-jupyter-intronextflow-app:v0.2.0" + name: "lrgassembly" + image: "ghcr.io/nesi/nesi/training-environment-jupyter-lrgassembly-app:v0.1.0" command: ["/bin/bash","-l","<%= staged_root %>/job_script_content.sh"] working_dir: "<%= Etc.getpwnam(ENV['USER']).dir %>" restart_policy: 'OnFailure' diff --git a/view.html.erb b/view.html.erb index 02f5786..ecc4a5d 100644 --- a/view.html.erb +++ b/view.html.erb @@ -1,6 +1,6 @@