diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 40b4976d8f1fa25fbc18d789b8ac61434dbcdeed..1b9364241bdeee70693fbdb233dd51e9ff4a8ef6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -186,3 +186,15 @@ deploy: except: - /^dev-.*$/ when: manual + +releaserawapi: + script: + - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab-registry.mpcdf.mpg.de + - cd ops/docker-compose/rawapi + # secret .env file is stored on the "production" machine and is bind mounted into the + # runner container at /nomad/config/.env + - cp /nomad/config/.rawapi_env .env + - docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d + except: + - /^dev-.*$/ + when: manual diff --git a/ops/docker-compose/rawapi/.gitignore b/ops/docker-compose/rawapi/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..4c49bd78f1d08f2bc09fa0bd8191ed38b7dce5e3 --- /dev/null +++ b/ops/docker-compose/rawapi/.gitignore @@ -0,0 +1 @@ +.env diff --git a/ops/docker-compose/rawapi/README.md b/ops/docker-compose/rawapi/README.md new file mode 100644 index 0000000000000000000000000000000000000000..04ff26e81aace6ad2c104b568ae85a4f218d274a --- /dev/null +++ b/ops/docker-compose/rawapi/README.md @@ -0,0 +1,13 @@ +Contains all files to run the rawapi with docker-compose on a single docker, both +for development and production. + +We use docker-compose overrides to modify config for development and production. Example: +``` +docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d +``` + +The different overrides are: +- *.prod.yml, production (currently on enc-preprocessing-nomad.esc) + +You have to create a .env file with the variable `RAW_FILE_DIR` to determine the +directory with the rawfiles: `<RAW_FILE_DIR>/data/R*.zip` . \ No newline at end of file diff --git a/ops/docker-compose/rawapi/docker-compose.prod.yml b/ops/docker-compose/rawapi/docker-compose.prod.yml new file mode 100644 index 0000000000000000000000000000000000000000..b65e72ee54722662f73694521005d975ef0105c5 --- /dev/null +++ b/ops/docker-compose/rawapi/docker-compose.prod.yml @@ -0,0 +1,21 @@ +# Copyright 2018 Markus Scheidgen +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an"AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +version: '3.4' + +services: + # nomad rawapi + api: + restart: always + image: gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-fair/rawapi:latest diff --git a/ops/docker-compose/rawapi/docker-compose.yml b/ops/docker-compose/rawapi/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..bb3b9fd2b8e27e9eaab9de95cd445a37ebf9567d --- /dev/null +++ b/ops/docker-compose/rawapi/docker-compose.yml @@ -0,0 +1,28 @@ +# Copyright 2018 Markus Scheidgen +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an"AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +version: '3.4' + +services: + # nomad rawapi + api: + image: nomad/rawapi + container_name: nomad_rawapi + environment: + NOMAD_API_BASE_PATH: /nomad/rawapi + NOMAD_SERVICE: rawapi + volumes: + - ${RAW_FILE_DIR}:/raw + ports: + - 8001:8000 diff --git a/ops/utils.http b/ops/utils.http index 080d7195a72be8f3e3f7d59b3491c161ff7f0bdd..136465f8875c1f0b05b6a88da4458e9bb5281522 100644 --- a/ops/utils.http +++ b/ops/utils.http @@ -48,7 +48,7 @@ GET http://localhost:8000/nomad/api/admin/repair_uploads HTTP/1.1 ### -GET http://localhost:8000/nomad/api/raw/test/some HTTP/1.1 +GET http://localhost:8001/nomad/rawapi/raw/WUTlEULVrv6jEgFvSaOX1j0pF7on/examples_vasp/xml/Si.xml HTTP/1.1 Accept: application/json ###