Skip to content

Commit

Permalink
update ghcr container version and add .workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
DininduSenanayake committed Jun 5, 2024
1 parent 89f925f commit 6013fac
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 11 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
@@ -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 }}

8 changes: 2 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions submit.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion view.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<form action="/node/<%= host %>/<%= port %>/login" method="post" target="_blank">
<input type="hidden" name="password" value="<%= password %>">
<button class="btn btn-primary" type="submit">
<i class="fa fa-registered"></i> Connect to Intro to Nextflow workshop app
<i class="fa fa-registered"></i> Connect to Long-read Genome Assembly workshop app
</button>
</form>

0 comments on commit 6013fac

Please sign in to comment.