From 0635880b3e97b617bc9dcf05d5603d72527821de Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 11 Nov 2024 10:10:16 +0000 Subject: [PATCH 1/2] Repository initialization --- .github/workflows/initialize.yml | 60 -------------------------------- README.md | 30 +++++----------- configs/nomad.yaml | 2 +- docker-compose.yaml | 8 ++--- 4 files changed, 14 insertions(+), 86 deletions(-) delete mode 100644 .github/workflows/initialize.yml diff --git a/.github/workflows/initialize.yml b/.github/workflows/initialize.yml deleted file mode 100644 index 5ed2e66..0000000 --- a/.github/workflows/initialize.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Template Repository Initialization - -on: - # Triggers the workflow on creation of repository - create: - workflow_dispatch: - -env: - # Use docker.io for Docker Hub if empty - REGISTRY: ghcr.io - # github.repository as / - IMAGE_NAME: ${{ github.repository }} - -permissions: - contents: write - -jobs: - initialize_repository: - if: github.repository != 'FAIRmat-NFDI/nomad-distribution-template' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - # Replaces the template repository name in the README with the new one - - name: Update README - run: | - sed -i "/# NOMAD Oasis Distribution/,/button on the right./d" README.md - export image_name="${{ github.repository }}" - sed -i "s|fairmat-nfdi/nomad-distribution-template|${image_name,,}|g" README.md - sed -i "s|FAIRmat-NFDI/nomad-distribution-template|${{ github.repository }}|g" README.md - sed -i "s|FAIRmat-NFDI|${{ github.repository_owner }}|g" README.md - sed -i "s|nomad-distribution-template|${{ github.event.repository.name }}|g" README.md - sed -i "s|template https://github.com/${{ github.repository }}|template https://github.com/FAIRmat-NFDI/nomad-distribution-template|g" README.md - sed -i "s|${{ github.repository }}/releases/latest|FAIRmat-NFDI/nomad-distribution-template/releases/latest|g" README.md - sed -i "s|@ git+https://github.com/${{ github.repository_owner }}|@ git+https://github.com/FAIRmat-NFDI|g" README.md - - # Replaces the template repository name in the docker config file with the new one - - name: Update docker-compose.yaml - run: | - export image_name="${{ github.repository }}" - sed -i "s|fairmat-nfdi/nomad-distribution-template|${image_name,,}|g" docker-compose.yaml - - # Replaces the template repository name in the nomad config with the new one - - name: Update nomad.yaml - run: | - export image_name="${{ github.repository }}" - sed -i "s|fairmat-nfdi/nomad-distribution-template|${image_name,,}|g" configs/nomad.yaml - - # Deletes this workflow file to prevent it from running on branch creation - - name: Delete initialization workflow - run: rm .github/workflows/initialize.yml - - # Commits all changes - - name: Commit repository initialization - run: | - git config --global user.name github-actions - git config --global user.email github-actions@github.com - git commit -am "Repository initialization" - git push diff --git a/README.md b/README.md index 682fe73..177d5ed 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,5 @@ -![docker image](https://github.com/FAIRmat-NFDI/nomad-distribution-template/actions/workflows/docker-publish.yml/badge.svg) +![docker image](https://github.com/FAIRmat-NFDI/nomad-distro-template/actions/workflows/docker-publish.yml/badge.svg) -# NOMAD Oasis Distribution *Template* -This repository is a template for creating your own custom NOMAD Oasis distribution image. -Click [here](https://github.com/new?template_name=nomad-distribution-template&template_owner=FAIRmat-NFDI) -to use this template, or click the `Use this template` button in the upper right corner of -the main GitHub page for this template. - -> [!IMPORTANT] -> The templated repository will run a GitHub action on creation which might take a few minutes. -> After the workflow finishes you should refresh the page and this message should disappear. -> If this message persists you might need to trigger the workflow manually by navigating to the -> "Actions" tab at the top, clicking "Template Repository Initialization" on the left side, -> and triggering it by clicking "Run workflow" under the "Run workflow" button on the right. # FAIRmat-NFDI's NOMAD Oasis Distribution @@ -54,16 +42,16 @@ Below are instructions for how to deploy this NOMAD Oasis distribution 2. Clone the repository or download the repository as a zip file. ```sh - git clone https://github.com/FAIRmat-NFDI/nomad-distribution-template.git - cd nomad-distribution-template + git clone https://github.com/FAIRmat-NFDI/nomad-distro-template.git + cd nomad-distro-template ``` or ```sh - curl-L -o nomad-distribution-template.zip "https://github.com/FAIRmat-NFDI/nomad-distribution-template/archive/main.zip" - unzip nomad-distribution-template.zip - cd nomad-distribution-template + curl-L -o nomad-distro-template.zip "https://github.com/FAIRmat-NFDI/nomad-distro-template/archive/main.zip" + unzip nomad-distro-template.zip + cd nomad-distro-template ``` 3. _On Linux only,_ recursively change the owner of the `.volumes` directory to the nomad user (1000) @@ -118,7 +106,7 @@ You can find more details on setting up and maintaining an Oasis in the NOMAD do ### For an existing Oasis If you already have an Oasis running you only need to change the image being pulled in -your `docker-compose.yaml` with `ghcr.io/fairmat-nfdi/nomad-distribution-template:main` for the services +your `docker-compose.yaml` with `ghcr.io/fairmat-nfdi/nomad-distro-template:main` for the services `worker`, `app`, `north`, and `logtransfer`. If you want to use the `nomad.yaml` from this repository you also need to comment out @@ -183,7 +171,7 @@ This image has been added to the [`configs/nomad.yaml`](configs/nomad.yaml) duri The image is quite large and might cause a timeout the first time it is run. In order to avoid this you can pre pull the image with: ``` -docker pull ghcr.io/fairmat-nfdi/nomad-distribution-template/jupyter:main +docker pull ghcr.io/fairmat-nfdi/nomad-distro-template/jupyter:main ``` If you want additional python packages to be available to all users in the jupyter hub you can add those to the jupyter table in the [`pyproject.toml`](pyproject.toml): @@ -230,7 +218,7 @@ Ideally all workflows should be triggered automatically but you might need to ru ## FAQ/Trouble shooting -_I get an_ `Error response from daemon: Head "https://ghcr.io/v2/FAIRmat-NFDI/nomad-distribution-template/manifests/main": unauthorized` +_I get an_ `Error response from daemon: Head "https://ghcr.io/v2/FAIRmat-NFDI/nomad-distro-template/manifests/main": unauthorized` _when trying to pull my docker image._ Most likely you have not made the package public or provided a personal access token (PAT). diff --git a/configs/nomad.yaml b/configs/nomad.yaml index b23f063..b7493ff 100644 --- a/configs/nomad.yaml +++ b/configs/nomad.yaml @@ -11,7 +11,7 @@ north: tools: options: jupyter: - image: ghcr.io/fairmat-nfdi/nomad-distribution-template/jupyter:main + image: ghcr.io/fairmat-nfdi/nomad-distro-template/jupyter:main meta: deployment: "oasis" diff --git a/docker-compose.yaml b/docker-compose.yaml index 2fbfb4d..f9c2726 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -68,7 +68,7 @@ services: # nomad worker (processing) worker: restart: unless-stopped - image: ghcr.io/fairmat-nfdi/nomad-distribution-template:main + image: ghcr.io/fairmat-nfdi/nomad-distro-template:main container_name: nomad_oasis_worker environment: NOMAD_SERVICE: nomad_oasis_worker @@ -91,7 +91,7 @@ services: # nomad app (api + proxy) app: restart: unless-stopped - image: ghcr.io/fairmat-nfdi/nomad-distribution-template:main + image: ghcr.io/fairmat-nfdi/nomad-distro-template:main container_name: nomad_oasis_app environment: NOMAD_SERVICE: nomad_oasis_app @@ -130,7 +130,7 @@ services: # nomad remote tools hub (JupyterHUB, e.g. for AI Toolkit) north: restart: unless-stopped - image: ghcr.io/fairmat-nfdi/nomad-distribution-template:main + image: ghcr.io/fairmat-nfdi/nomad-distro-template:main container_name: nomad_oasis_north environment: NOMAD_SERVICE: nomad_oasis_north @@ -165,7 +165,7 @@ services: # to enable the logtransfer service run "docker compose --profile with_logtransfer up" logtransfer: restart: unless-stopped - image: ghcr.io/fairmat-nfdi/nomad-distribution-template:main + image: ghcr.io/fairmat-nfdi/nomad-distro-template:main container_name: nomad_oasis_logtransfer environment: NOMAD_SERVICE: nomad_oasis_logtransfer From 699c59e25ce9500d9dfab65bbef9354821d360f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hampus=20N=C3=A4sstr=C3=B6m?= Date: Mon, 11 Nov 2024 11:50:06 +0100 Subject: [PATCH 2/2] Changed repository name --- .github/workflows/initialize.yml | 16 ++++++++-------- README.md | 24 ++++++++++++------------ configs/nomad.yaml | 2 +- docker-compose.yaml | 8 ++++---- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/initialize.yml b/.github/workflows/initialize.yml index 5ed2e66..6cfe15c 100644 --- a/.github/workflows/initialize.yml +++ b/.github/workflows/initialize.yml @@ -16,7 +16,7 @@ permissions: jobs: initialize_repository: - if: github.repository != 'FAIRmat-NFDI/nomad-distribution-template' + if: github.repository != 'FAIRmat-NFDI/nomad-distro-template' runs-on: ubuntu-latest steps: @@ -27,25 +27,25 @@ jobs: run: | sed -i "/# NOMAD Oasis Distribution/,/button on the right./d" README.md export image_name="${{ github.repository }}" - sed -i "s|fairmat-nfdi/nomad-distribution-template|${image_name,,}|g" README.md - sed -i "s|FAIRmat-NFDI/nomad-distribution-template|${{ github.repository }}|g" README.md + sed -i "s|fairmat-nfdi/nomad-distro-template|${image_name,,}|g" README.md + sed -i "s|FAIRmat-NFDI/nomad-distro-template|${{ github.repository }}|g" README.md sed -i "s|FAIRmat-NFDI|${{ github.repository_owner }}|g" README.md - sed -i "s|nomad-distribution-template|${{ github.event.repository.name }}|g" README.md - sed -i "s|template https://github.com/${{ github.repository }}|template https://github.com/FAIRmat-NFDI/nomad-distribution-template|g" README.md - sed -i "s|${{ github.repository }}/releases/latest|FAIRmat-NFDI/nomad-distribution-template/releases/latest|g" README.md + sed -i "s|nomad-distro-template|${{ github.event.repository.name }}|g" README.md + sed -i "s|template https://github.com/${{ github.repository }}|template https://github.com/FAIRmat-NFDI/nomad-distro-template|g" README.md + sed -i "s|${{ github.repository }}/releases/latest|FAIRmat-NFDI/nomad-distro-template/releases/latest|g" README.md sed -i "s|@ git+https://github.com/${{ github.repository_owner }}|@ git+https://github.com/FAIRmat-NFDI|g" README.md # Replaces the template repository name in the docker config file with the new one - name: Update docker-compose.yaml run: | export image_name="${{ github.repository }}" - sed -i "s|fairmat-nfdi/nomad-distribution-template|${image_name,,}|g" docker-compose.yaml + sed -i "s|fairmat-nfdi/nomad-distro-template|${image_name,,}|g" docker-compose.yaml # Replaces the template repository name in the nomad config with the new one - name: Update nomad.yaml run: | export image_name="${{ github.repository }}" - sed -i "s|fairmat-nfdi/nomad-distribution-template|${image_name,,}|g" configs/nomad.yaml + sed -i "s|fairmat-nfdi/nomad-distro-template|${image_name,,}|g" configs/nomad.yaml # Deletes this workflow file to prevent it from running on branch creation - name: Delete initialization workflow diff --git a/README.md b/README.md index 682fe73..8b49f39 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -![docker image](https://github.com/FAIRmat-NFDI/nomad-distribution-template/actions/workflows/docker-publish.yml/badge.svg) +![docker image](https://github.com/FAIRmat-NFDI/nomad-distro-template/actions/workflows/docker-publish.yml/badge.svg) # NOMAD Oasis Distribution *Template* This repository is a template for creating your own custom NOMAD Oasis distribution image. -Click [here](https://github.com/new?template_name=nomad-distribution-template&template_owner=FAIRmat-NFDI) +Click [here](https://github.com/new?template_name=nomad-distro-template&template_owner=FAIRmat-NFDI) to use this template, or click the `Use this template` button in the upper right corner of the main GitHub page for this template. @@ -54,16 +54,16 @@ Below are instructions for how to deploy this NOMAD Oasis distribution 2. Clone the repository or download the repository as a zip file. ```sh - git clone https://github.com/FAIRmat-NFDI/nomad-distribution-template.git - cd nomad-distribution-template + git clone https://github.com/FAIRmat-NFDI/nomad-distro-template.git + cd nomad-distro-template ``` or ```sh - curl-L -o nomad-distribution-template.zip "https://github.com/FAIRmat-NFDI/nomad-distribution-template/archive/main.zip" - unzip nomad-distribution-template.zip - cd nomad-distribution-template + curl-L -o nomad-distro-template.zip "https://github.com/FAIRmat-NFDI/nomad-distro-template/archive/main.zip" + unzip nomad-distro-template.zip + cd nomad-distro-template ``` 3. _On Linux only,_ recursively change the owner of the `.volumes` directory to the nomad user (1000) @@ -118,7 +118,7 @@ You can find more details on setting up and maintaining an Oasis in the NOMAD do ### For an existing Oasis If you already have an Oasis running you only need to change the image being pulled in -your `docker-compose.yaml` with `ghcr.io/fairmat-nfdi/nomad-distribution-template:main` for the services +your `docker-compose.yaml` with `ghcr.io/fairmat-nfdi/nomad-distro-template:main` for the services `worker`, `app`, `north`, and `logtransfer`. If you want to use the `nomad.yaml` from this repository you also need to comment out @@ -183,7 +183,7 @@ This image has been added to the [`configs/nomad.yaml`](configs/nomad.yaml) duri The image is quite large and might cause a timeout the first time it is run. In order to avoid this you can pre pull the image with: ``` -docker pull ghcr.io/fairmat-nfdi/nomad-distribution-template/jupyter:main +docker pull ghcr.io/fairmat-nfdi/nomad-distro-template/jupyter:main ``` If you want additional python packages to be available to all users in the jupyter hub you can add those to the jupyter table in the [`pyproject.toml`](pyproject.toml): @@ -205,7 +205,7 @@ jupyter = [ In order to update an existing distribution with any potential changes in the template you can add a new `git remote` for the template and merge with that one while allowing for unrelated histories: ``` -git remote add template https://github.com/FAIRmat-NFDI/nomad-distribution-template +git remote add template https://github.com/FAIRmat-NFDI/nomad-distro-template git fetch template git merge template/main --allow-unrelated-histories ``` @@ -217,7 +217,7 @@ git checkout --theirs Dockerfile git checkout --theirs .github/workflows/docker-publish.yml ``` -For detailed instructions on how to resolve the merge conflicts between different version we refer you to the latest template release [notes](https://github.com/FAIRmat-NFDI/nomad-distribution-template/releases/latest) +For detailed instructions on how to resolve the merge conflicts between different version we refer you to the latest template release [notes](https://github.com/FAIRmat-NFDI/nomad-distro-template/releases/latest) Once the merge conflicts are resolved you should add the changes and commit them @@ -230,7 +230,7 @@ Ideally all workflows should be triggered automatically but you might need to ru ## FAQ/Trouble shooting -_I get an_ `Error response from daemon: Head "https://ghcr.io/v2/FAIRmat-NFDI/nomad-distribution-template/manifests/main": unauthorized` +_I get an_ `Error response from daemon: Head "https://ghcr.io/v2/FAIRmat-NFDI/nomad-distro-template/manifests/main": unauthorized` _when trying to pull my docker image._ Most likely you have not made the package public or provided a personal access token (PAT). diff --git a/configs/nomad.yaml b/configs/nomad.yaml index b23f063..b7493ff 100644 --- a/configs/nomad.yaml +++ b/configs/nomad.yaml @@ -11,7 +11,7 @@ north: tools: options: jupyter: - image: ghcr.io/fairmat-nfdi/nomad-distribution-template/jupyter:main + image: ghcr.io/fairmat-nfdi/nomad-distro-template/jupyter:main meta: deployment: "oasis" diff --git a/docker-compose.yaml b/docker-compose.yaml index 2fbfb4d..f9c2726 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -68,7 +68,7 @@ services: # nomad worker (processing) worker: restart: unless-stopped - image: ghcr.io/fairmat-nfdi/nomad-distribution-template:main + image: ghcr.io/fairmat-nfdi/nomad-distro-template:main container_name: nomad_oasis_worker environment: NOMAD_SERVICE: nomad_oasis_worker @@ -91,7 +91,7 @@ services: # nomad app (api + proxy) app: restart: unless-stopped - image: ghcr.io/fairmat-nfdi/nomad-distribution-template:main + image: ghcr.io/fairmat-nfdi/nomad-distro-template:main container_name: nomad_oasis_app environment: NOMAD_SERVICE: nomad_oasis_app @@ -130,7 +130,7 @@ services: # nomad remote tools hub (JupyterHUB, e.g. for AI Toolkit) north: restart: unless-stopped - image: ghcr.io/fairmat-nfdi/nomad-distribution-template:main + image: ghcr.io/fairmat-nfdi/nomad-distro-template:main container_name: nomad_oasis_north environment: NOMAD_SERVICE: nomad_oasis_north @@ -165,7 +165,7 @@ services: # to enable the logtransfer service run "docker compose --profile with_logtransfer up" logtransfer: restart: unless-stopped - image: ghcr.io/fairmat-nfdi/nomad-distribution-template:main + image: ghcr.io/fairmat-nfdi/nomad-distro-template:main container_name: nomad_oasis_logtransfer environment: NOMAD_SERVICE: nomad_oasis_logtransfer