diff --git a/.github/workflows/initialize.yml b/.github/workflows/initialize.yml index 3420d03..40faec5 100644 --- a/.github/workflows/initialize.yml +++ b/.github/workflows/initialize.yml @@ -31,10 +31,12 @@ jobs: # Replaces the template repository name in the docker config file with the new one - name: Update docker-compose.yaml - working-directory: ./nomad-oasis_files run: | - sed -i "s|FAIRmat-NFDI/nomad-distribution-template|${{ github.repository }}|g" nomad-oasis/docker-compose.yaml - zip -r nomad-oasis.zip nomad-oasis + sed -i "s|FAIRmat-NFDI/nomad-distribution-template|${{ github.repository }}|g" docker-compose.yaml + mkdir nomad-oasis + cp docker-compose.yaml nomad-oasis + zip -ur nomad-oasis.zip nomad-oasis + rm -r nomad-oasis # 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 3647ce1..d5aec24 100644 --- a/README.md +++ b/README.md @@ -10,19 +10,18 @@ Click [here](https://github.com/new?template_name=nomad-distribution-template&te to use this template, or click the `Use this template` button in the upper right corner of the main GitHub page for this template. -## Deploying the image +## Deploying the distribution -To deploy this NOMAD Oasis image you should follow the instructions on [nomad-lab.eu/prod/v1/docs/oasis/install.html](https://nomad-lab.eu/prod/v1/docs/oasis/install.html) but replace the Docker image in `docker-compose.yaml` with `ghcr.io/FAIRmat-NFDI/nomad-distribution-template:main` for the services `worker`, `app`, `north`, and `logtransfer`. +Below are instructions for how to deploy this NOMAD Oasis distribution +[for a new Oasis](#for-a-new-oasis) and [for an existing Oasis](#for-an-existing-oasis) -Remember to also update the `nomad.yaml` config file to include the new plugins. - -### Quick-start +### For a new Oasis - Find a linux computer. - Make sure you have [docker](https://docs.docker.com/engine/install/) installed. Docker nowadays comes with `docker compose` build in. Prior, you needed to install the stand alone [docker-compose](https://docs.docker.com/compose/install/). -- Download the modified configuration files [nomad-oasis.zip](nomad-oasis_files/nomad-oasis.zip) from this repository. +- Download the modified configuration files [nomad-oasis.zip](nomad-oasis.zip) from this repository. - Run the following commands (skip `chown` on MacOS and Windows computers) @@ -42,3 +41,21 @@ the container has to be run under the docker group. You need to replace the defa id `991` in the `docker-compose.yaml`'s `hub` section with your systems docker group id. Run `id` if you are a docker user, or `getent group | grep docker` to find our your systems docker gid. The user id 1000 is used as the nomad user inside all containers. + +You can find more details on setting up and maintaining an Oasis in the NOMAD docs here: +[nomad-lab.eu/prod/v1/docs/oasis/install.html](https://nomad-lab.eu/prod/v1/docs/oasis/install.html) + +### 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/GITHUB_REPOSITORY: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 +the inclusion of the `nomad.yaml` under the volumes key of those services in the +`docker-compose.yaml`. + +```yaml + volumes: + # - ./configs/nomad.yaml:/app/nomad.yaml +``` diff --git a/nomad-oasis_files/nomad-oasis/docker-compose.yaml b/docker-compose.yaml similarity index 100% rename from nomad-oasis_files/nomad-oasis/docker-compose.yaml rename to docker-compose.yaml diff --git a/nomad-oasis_files/nomad-oasis.zip b/nomad-oasis.zip similarity index 92% rename from nomad-oasis_files/nomad-oasis.zip rename to nomad-oasis.zip index 1d6684e..75b59d7 100644 Binary files a/nomad-oasis_files/nomad-oasis.zip and b/nomad-oasis.zip differ diff --git a/nomad-oasis_files/nomad-oasis/configs/nginx.conf b/nomad-oasis_files/nomad-oasis/configs/nginx.conf deleted file mode 100644 index 1b8531f..0000000 --- a/nomad-oasis_files/nomad-oasis/configs/nginx.conf +++ /dev/null @@ -1,82 +0,0 @@ -map $http_upgrade $connection_upgrade { - default upgrade; - '' close; -} - -server { - listen 80; - server_name localhost; - proxy_set_header Host $host; - - gzip_min_length 1000; - gzip_buffers 4 8k; - gzip_http_version 1.0; - gzip_disable "msie6"; - gzip_vary on; - gzip on; - gzip_proxied any; - gzip_types - text/css - text/javascript - text/xml - text/plain - application/javascript - application/x-javascript - application/json; - - location / { - proxy_pass http://app:8000; - } - - location ~ /nomad-oasis\/?(gui)?$ { - rewrite ^ /nomad-oasis/gui/ permanent; - } - - location /nomad-oasis/gui/ { - proxy_intercept_errors on; - error_page 404 = @redirect_to_index; - proxy_pass http://app:8000; - } - - location @redirect_to_index { - rewrite ^ /nomad-oasis/gui/index.html break; - proxy_pass http://app:8000; - } - - location ~ \/gui\/(service-worker\.js|meta\.json)$ { - add_header Last-Modified $date_gmt; - add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; - if_modified_since off; - expires off; - etag off; - proxy_pass http://app:8000; - } - - location ~ /api/v1/uploads(/?$|.*/raw|.*/bundle?$) { - client_max_body_size 35g; - proxy_request_buffering off; - proxy_pass http://app:8000; - } - - location ~ /api/v1/.*/download { - proxy_buffering off; - proxy_pass http://app:8000; - } - - location /nomad-oasis/north/ { - client_max_body_size 500m; - proxy_pass http://north:9000; - - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - - # websocket headers - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - proxy_set_header X-Scheme $scheme; - - proxy_buffering off; - } -} diff --git a/nomad-oasis_files/nomad-oasis/configs/nomad.yaml b/nomad-oasis_files/nomad-oasis/configs/nomad.yaml deleted file mode 100644 index 6b03954..0000000 --- a/nomad-oasis_files/nomad-oasis/configs/nomad.yaml +++ /dev/null @@ -1,34 +0,0 @@ -services: - api_host: 'localhost' - api_base_path: '/nomad-oasis' - -oasis: - is_oasis: true - uses_central_user_management: true - -north: - jupyterhub_crypt_key: '978bfb2e13a8448a253c629d8dd84ff89587f30e635b753153960930cad9d36d' - -meta: - deployment: 'oasis' - deployment_url: 'https://my-oasis.org/api' - maintainer_email: 'me@my-oasis.org' - -logstash: - enable: false - -mongo: - db_name: nomad_oasis_v1 - -elastic: - entries_index: nomad_oasis_entries_v1 - materials_index: nomad_oasis_materials_v1 - -plugins: - options: - schemas/nomad_material_processing: - python_package: nomad_material_processing - schemas/nomad_measurements: - python_package: nomad_measurements - parsers/nomad_measurements/xrd: - python_package: nomad_measurements.xrd.parser \ No newline at end of file diff --git a/template_README.md b/template_README.md index 2519b26..4334a0e 100644 --- a/template_README.md +++ b/template_README.md @@ -3,8 +3,8 @@ # GITHUB_REPOSITORY_OWNER's NOMAD Oasis Distribution This is the NOMAD Oasis distribution of GITHUB_REPOSITORY_OWNER. -Below are instructions for how to [deploy this image](#deploying-the-image) and how to -customize it through [adding plugins](#adding-a-plugin). +Below are instructions for how to [deploy this distribution](#deploying-the-distribution) +and how to customize it through [adding plugins](#adding-a-plugin). > [!IMPORTANT] > Depending on the settings of the owner of this repository, the distributed image might @@ -18,22 +18,18 @@ customize it through [adding plugins](#adding-a-plugin). > greatly appreciate it if you would add the topic `nomad-distribution` by clicking the > ⚙️ next to "About" on the main GitHub page for this repository. -## Deploying the image +## Deploying the distribution -To deploy this NOMAD Oasis image you should follow the instructions on -[nomad-lab.eu/prod/v1/docs/oasis/install.html](https://nomad-lab.eu/prod/v1/docs/oasis/install.html) -but replace the Docker image in `docker-compose.yaml` with `ghcr.io/GITHUB_REPOSITORY:main` -for the services `worker`, `app`, `north`, and `logtransfer`. - -Remember to also update the `nomad.yaml` config file to include the new plugins. +Below are instructions for how to deploy this NOMAD Oasis distribution +[for a new Oasis](#for-a-new-oasis) and [for an existing Oasis](#for-an-existing-oasis) -### Quick-start +### For a new Oasis - Find a linux computer. - Make sure you have [docker](https://docs.docker.com/engine/install/) installed. Docker nowadays comes with `docker compose` build in. Prior, you needed to install the stand alone [docker-compose](https://docs.docker.com/compose/install/). -- Download the modified configuration files [nomad-oasis.zip](nomad-oasis_files/nomad-oasis.zip) from this repository. +- Download the modified configuration files [nomad-oasis.zip](nomad-oasis.zip) from this repository. - Run the following commands (skip `chown` on MacOS and Windows computers) @@ -54,6 +50,24 @@ id `991` in the `docker-compose.yaml`'s `hub` section with your systems docker g Run `id` if you are a docker user, or `getent group | grep docker` to find our your systems docker gid. The user id 1000 is used as the nomad user inside all containers. +You can find more details on setting up and maintaining an Oasis in the NOMAD docs here: +[nomad-lab.eu/prod/v1/docs/oasis/install.html](https://nomad-lab.eu/prod/v1/docs/oasis/install.html) + +### 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/GITHUB_REPOSITORY: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 +the inclusion of the `nomad.yaml` under the volumes key of those services in the +`docker-compose.yaml`. + +```yaml + volumes: + # - ./configs/nomad.yaml:/app/nomad.yaml +``` + ## Adding a plugin To add a new plugin to the docker image you should add it to the [plugins.txt](plugins.txt) file.