diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 5181ad7..cf024d7 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -1,19 +1,69 @@ name: Docker Image CI -on: [push] +on: ["push", "workflow_dispatch"] + jobs: - build: - + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: hadolint/hadolint-action@v3.1.0 + with: + dockerfile: Dockerfile + + test: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Build the Docker image + - uses: actions/checkout@v4 + - name: Set up environment + run: | + echo "BIOMAJ_DIR=$(pwd)" > .env + echo "BIOMAJ_DATA_DIR=$(pwd)/biomaj" >> .env + mkdir -p biomaj biomaj/conf biomaj/log biomaj/lock biomaj/db biomaj/process biomaj/cache + cp test-local/etc/biomaj/conf.d/alu.properties biomaj/conf/ + cp test-local/etc/biomaj/conf.d/local.properties biomaj/conf/ + - name: Validate Docker Compose configuration + run: | + docker compose config -q + - name: Build Docker image + run: | + docker compose build --no-cache + - name: Start Docker containers + run: | + docker compose up -d + - name: Execute test script run: | - docker build . --file Dockerfile --tag docker.pkg.github.com/genouest/biomaj-docker/biomaj:$GITHUB_SHA - docker login docker.pkg.github.com -u ${{ secrets.GHR_USER }} -p ${{ secrets.GHR_TOKEN }} - docker push docker.pkg.github.com/genouest/biomaj-docker/biomaj:$GITHUB_SHA - - + sleep 20 + ./docker-test.sh local + - name: Shut down Docker containers + run: | + docker compose down + + publish: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: genouest/biomaj-docker + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitignore b/.gitignore index 61310a5..f75526a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ .env biomaj -!*biomaj/ mongo redis rabbitmq diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000..77ebb91 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,7 @@ +ignored: + - DL3008 + - DL3003 + - DL4006 + - DL4001 + - DL3013 + - SC2086 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 10d96e4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -sudo: required - -services: - - docker - -before_install: - - echo "BIOMAJ_DIR=$(pwd)" > .env - - echo "BIOMAJ_DATA_DIR=$(pwd)/biomaj" >> .env - - mkdir -p biomaj biomaj/conf biomaj/log biomaj/lock biomaj/db biomaj/process biomaj/cache - - cp test-local/etc/biomaj/conf.d/alu.properties biomaj/conf/ - - cp test-local/etc/biomaj/conf.d/local.properties biomaj/conf/ - -script: - - docker run --rm -i hadolint/hadolint < Dockerfile || true - - docker-compose config --q - - docker build -t quay.io/osallou/biomaj . - - docker-compose up -d - - sleep 20 - - ./docker-test.sh local - - docker-compose down diff --git a/CHANGES.txt b/CHANGES.md similarity index 94% rename from CHANGES.txt rename to CHANGES.md index 9612dd4..b2a2249 100644 --- a/CHANGES.txt +++ b/CHANGES.md @@ -2,7 +2,10 @@ Notes: requires mongo 3.x -## shahikorma +## v14 - TBR + +/!\ Breaking: Upgrading prometheus version from 2.45.6. Data will be lost in the upgrade. +* Various fixes and cleanup ## v13 - 2022-04-28 @@ -84,4 +87,3 @@ Notes: requires mongo 3.x * Add naming in versions * Force pika library version 0.11.2 in biomaj-download and biomaj-process (latest not working) - diff --git a/Dockerfile b/Dockerfile index ba7179d..6c66243 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,119 +1,86 @@ -FROM quay.io/osallou/debian:buster +FROM debian:bullseye WORKDIR /root ENV BIOMAJ_CONFIG=/root/config.yml ENV prometheus_multiproc_dir=/tmp/biomaj-prometheus-multiproc -RUN rm -rf /tmp/biomaj-prometheus-multiproc -RUN mkdir -p /tmp/biomaj-prometheus-multiproc - -RUN apt-get update && apt-get install -y apt-transport-https curl libcurl4-openssl-dev python3-pycurl python3-setuptools python3-pip git unzip bzip2 ca-certificates jq --no-install-recommends +RUN rm -rf /tmp/biomaj-prometheus-multiproc && \ + mkdir -p /tmp/biomaj-prometheus-multiproc # Install docker to allow docker execution from process-message -RUN buildDeps='gnupg2 dirmngr software-properties-common' \ - && set -x \ - && apt-get install -y $buildDeps --no-install-recommends \ +RUN buildDeps='gnupg2 dirmngr' \ + && apt-get update \ + && apt-get install -y apt-transport-https curl libcurl4-openssl-dev python3-pycurl python3-setuptools python3-pip git unzip bzip2 ca-certificates jq $buildDeps --no-install-recommends \ + && echo 'deb [arch=amd64] https://download.docker.com/linux/debian buster stable' | tee /etc/apt/sources.list.d/docker.list \ && curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \ - && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \ && apt-get update \ - && apt-get install -y docker-ce-cli \ - && apt-get purge -y --auto-remove $buildDeps - -ENV BIOMAJ_RELEASE="shahikorma-v13" - -RUN git clone https://github.com/genouest/biomaj-core.git -#RUN easy_install3 pip -RUN pip3 install setuptools --upgrade - -RUN git clone https://github.com/genouest/biomaj-zipkin.git - -RUN git clone https://github.com/genouest/biomaj-user.git - -RUN git clone https://github.com/genouest/biomaj-cli.git - -RUN git clone https://github.com/genouest/biomaj-process.git - -RUN git clone https://github.com/genouest/biomaj-download.git - -RUN git clone https://github.com/genouest/biomaj.git && echo "Install biomaj" - -RUN git clone https://github.com/genouest/biomaj-daemon.git && echo "Install daemon" - -RUN git clone https://github.com/genouest/biomaj-watcher.git && echo "Install biomaj-watcher" - -RUN git clone https://github.com/genouest/biomaj-ftp.git + && apt-get install --no-install-recommends -y docker-ce-cli \ + && apt-get purge -y --auto-remove $buildDeps \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* -RUN git clone https://github.com/genouest/biomaj-release.git +ENV BIOMAJ_RELEASE="14" -RUN git clone https://github.com/genouest/biomaj-data.git +RUN git clone https://github.com/genouest/biomaj-process.git && \ + git clone https://github.com/genouest/biomaj-download.git ENV BIOMAJ_CONFIG=/etc/biomaj/config.yml RUN mkdir -p /var/log/biomaj -RUN pip3 install greenlet==0.4.17 -RUN pip3 install gevent==1.4.0 -RUN pip3 install graypy -RUN pip3 install pymongo==3.12.3 -RUN pip3 install redis==3.5.3 -RUN pip3 install wheel -RUN pip3 install PyYAML==5.3.1 +RUN pip3 install --no-cache-dir pip --upgrade && \ + pip3 install --no-cache-dir setuptools --upgrade && \ + pip3 install --no-cache-dir greenlet==0.4.17 && \ + pip3 install --no-cache-dir graypy && \ + pip3 install --no-cache-dir pymongo==3.12.3 && \ + pip3 install --no-cache-dir redis==3.5.3 && \ + pip3 install --no-cache-dir wheel && \ + pip3 install --no-cache-dir PyYAML==5.4.1 && \ + pip3 install --no-cache-dir protobuf==3.20.3 && \ + python3 -m pip install --no-cache-dir ftputil ENV SUDO_FORCE_REMOVE=yes -RUN buildDeps='gcc python3-dev protobuf-compiler' \ +RUN buildDeps="gcc python3-dev protobuf-compiler" \ && set -x \ + && apt-get update \ && apt-get install -y $buildDeps --no-install-recommends \ - && cd /root/biomaj-core && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-zipkin && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-user && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-cli && python3 setup.py build && pip3 install . \ + && pip install git+https://github.com/genouest/biomaj-core.git --no-cache-dir \ + && pip install git+https://github.com/genouest/biomaj-zipkin.git --no-cache-dir \ + && pip install git+https://github.com/genouest/biomaj-user.git --no-cache-dir \ + && pip install git+https://github.com/genouest/biomaj-cli.git --no-cache-dir \ && cd /root/biomaj-process/biomaj_process/message && protoc --python_out=. procmessage.proto \ - && cd /root/biomaj-process && python3 setup.py build && pip3 install . \ + && pip install git+https://github.com/genouest/biomaj-process.git --no-cache-dir \ && cd /root/biomaj-download/biomaj_download/message && protoc --python_out=. downmessage.proto \ - && cd /root/biomaj-download && python3 setup.py build && pip3 install . \ - && cd /root/biomaj && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-daemon && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-watcher && pip3 install -r requirements.txt && pip3 install . \ - && cd /root/biomaj-ftp && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-release && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-data && python3 setup.py build && pip3 install . \ - && apt-get install -y wget bzip2 ca-certificates curl git \ + && pip install git+https://github.com/genouest/biomaj-download.git --no-cache-dir \ + && pip install git+https://github.com/genouest/biomaj.git --no-cache-dir \ + && pip install git+https://github.com/genouest/biomaj-daemon.git --no-cache-dir \ + && pip install git+https://github.com/genouest/biomaj-watcher.git --no-cache-dir \ + && pip install git+https://github.com/genouest/biomaj-ftp.git --no-cache-dir \ + && pip install git+https://github.com/genouest/biomaj-release.git --no-cache-dir \ + && pip install git+https://github.com/genouest/biomaj-data.git --no-cache-dir \ + && apt-get install --no-install-recommends -y wget bzip2 ca-certificates curl git nano python3-markupsafe python3-bcrypt python3-yapsy\ + && apt-get purge -y --auto-remove $buildDeps \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && apt-get purge -y --auto-remove $buildDeps + && rm -rf /var/lib/apt/lists/* - -#RUN apt-get update --fix-missing && \ -# apt-get install -y wget bzip2 ca-certificates curl git && \ -# apt-get clean && \ -# rm -rf /var/lib/apt/lists/* -RUN pip3 uninstall -y gunicorn && pip3 install gunicorn==19.9.0 -RUN pip3 uninstall -y greenlet && pip3 install greenlet==0.4.15 -RUN pip3 uninstall -y gevent && pip3 install gevent==1.3.7 - +RUN pip3 uninstall -y gunicorn && pip3 install --no-cache-dir gunicorn==19.9.0 #Conda installation and give write permissions to conda folder RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \ /bin/bash ~/miniconda.sh -b -p /opt/conda && \ - rm ~/miniconda.sh && \ - /opt/conda/bin/conda config --add channels r && \ - /opt/conda/bin/conda config --add channels bioconda && \ - /opt/conda/bin/conda upgrade -y conda && \ + rm ~/miniconda.sh && \ + /opt/conda/bin/conda config --add channels r && \ + /opt/conda/bin/conda config --add channels bioconda && \ + /opt/conda/bin/conda upgrade -y conda && \ chmod 777 -R /opt/conda/ - - RUN mkdir /data /config ENV PATH=$PATH:/opt/conda/bin -#RUN conda config --add channels r -#RUN conda config --add channels bioconda -#RUN conda upgrade -y conda - VOLUME ["/data", "/config"] RUN mkdir -p /var/lib/biomaj/data @@ -125,11 +92,11 @@ COPY biomaj-config/gunicorn_conf.py /etc/biomaj/gunicorn_conf.py COPY watcher.sh /root/watcher.sh # Local test configuration -RUN mkdir -p /etc/biomaj/conf.d -RUN mkdir -p /var/log/biomaj -RUN mkdir -p /etc/biomaj/process.d -RUN mkdir -p /var/cache/biomaj -RUN mkdir -p /var/run/biomaj +RUN mkdir -p /etc/biomaj/conf.d && \ + mkdir -p /var/log/biomaj && \ + mkdir -p /etc/biomaj/process.d && \ + mkdir -p /var/cache/biomaj && \ + mkdir -p /var/run/biomaj COPY test-local/etc/biomaj/global_local.properties /etc/biomaj/global_local.properties COPY test-local/etc/biomaj/conf.d/alu.properties /etc/biomaj/conf.d/alu.properties diff --git a/Dockerfile-deb11 b/Dockerfile-deb11 deleted file mode 100644 index 434ade0..0000000 --- a/Dockerfile-deb11 +++ /dev/null @@ -1,141 +0,0 @@ -FROM debian:bullseye - -WORKDIR /root -ENV BIOMAJ_CONFIG=/root/config.yml -ENV prometheus_multiproc_dir=/tmp/biomaj-prometheus-multiproc - -RUN rm -rf /tmp/biomaj-prometheus-multiproc -RUN mkdir -p /tmp/biomaj-prometheus-multiproc - -RUN apt-get update && apt-get install -y apt-transport-https curl libcurl4-openssl-dev python3-pycurl python3-setuptools python3-pip git unzip bzip2 ca-certificates jq --no-install-recommends - -# Install docker to allow docker execution from process-message -RUN buildDeps='gnupg2 dirmngr software-properties-common' \ - && set -x \ - && apt-get install -y $buildDeps --no-install-recommends \ - && curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \ - && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \ - && apt-get update \ - && apt-get install -y docker-ce-cli \ - && apt-get purge -y --auto-remove $buildDeps - -ENV BIOMAJ_RELEASE="shahikorma-v14-deb11" - -RUN git clone https://github.com/genouest/biomaj-core.git -#RUN easy_install3 pip -RUN pip3 install setuptools --upgrade - -RUN git clone https://github.com/genouest/biomaj-zipkin.git - -RUN git clone https://github.com/genouest/biomaj-user.git - -RUN git clone https://github.com/genouest/biomaj-cli.git - -RUN git clone https://github.com/genouest/biomaj-process.git - -RUN git clone https://github.com/genouest/biomaj-download.git - -RUN git clone https://github.com/genouest/biomaj.git && echo "Install biomaj" - -RUN git clone https://github.com/genouest/biomaj-daemon.git && echo "Install daemon" - -RUN git clone https://github.com/genouest/biomaj-watcher.git && echo "Install biomaj-watcher" - -RUN git clone https://github.com/genouest/biomaj-ftp.git - -RUN git clone https://github.com/genouest/biomaj-release.git - -RUN git clone https://github.com/genouest/biomaj-data.git - -ENV BIOMAJ_CONFIG=/etc/biomaj/config.yml - -RUN mkdir -p /var/log/biomaj - -#RUN pip3 install greenlet==0.4.17 -#RUN pip3 install gevent==1.4.0 -RUN pip3 install graypy -#RUN pip3 install pymongo==3.12.3 -#RUN pip3 install redis==3.5.3 -RUN pip3 install wheel -#RUN pip3 install PyYAML==5.3.1 - -ENV SUDO_FORCE_REMOVE=yes -RUN buildDeps='gcc python3-dev protobuf-compiler' \ - && set -x \ - && apt-get install -y $buildDeps --no-install-recommends \ - && cd /root/biomaj-core && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-zipkin && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-user && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-cli && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-process/biomaj_process/message && protoc --python_out=. procmessage.proto \ - && cd /root/biomaj-process && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-download/biomaj_download/message && protoc --python_out=. downmessage.proto \ - && cd /root/biomaj-download && python3 setup.py build && pip3 install . \ - && cd /root/biomaj && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-daemon && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-watcher && pip3 install -r requirements.txt && pip3 install . \ - && cd /root/biomaj-ftp && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-release && python3 setup.py build && pip3 install . \ - && cd /root/biomaj-data && python3 setup.py build && pip3 install . \ - && apt-get install -y wget bzip2 ca-certificates curl git \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && apt-get purge -y --auto-remove $buildDeps - - - -#RUN apt-get update --fix-missing && \ -# apt-get install -y wget bzip2 ca-certificates curl git && \ -# apt-get clean && \ -# rm -rf /var/lib/apt/lists/* -#RUN pip3 uninstall -y gunicorn && pip3 install gunicorn==19.9.0 -#RUN pip3 uninstall -y greenlet && pip3 install greenlet==0.4.15 -#RUN pip3 uninstall -y gevent && pip3 install gevent==1.3.7 - - - -#Conda installation and give write permissions to conda folder -RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \ - /bin/bash ~/miniconda.sh -b -p /opt/conda && \ - rm ~/miniconda.sh && \ - /opt/conda/bin/conda config --add channels r && \ - /opt/conda/bin/conda config --add channels bioconda && \ - /opt/conda/bin/conda upgrade -y conda && \ - chmod 777 -R /opt/conda/ - - - - -RUN mkdir /data /config - -ENV PATH=$PATH:/opt/conda/bin - -#RUN conda config --add channels r -#RUN conda config --add channels bioconda -#RUN conda upgrade -y conda - -VOLUME ["/data", "/config"] - -RUN mkdir -p /var/lib/biomaj/data - -COPY biomaj-config/config.yml /etc/biomaj/config.yml -COPY biomaj-config/global.properties /etc/biomaj/global.properties -COPY biomaj-config/production.ini /etc/biomaj/production.ini -COPY biomaj-config/gunicorn_conf.py /etc/biomaj/gunicorn_conf.py -COPY watcher.sh /root/watcher.sh - -# Local test configuration -RUN mkdir -p /etc/biomaj/conf.d -RUN mkdir -p /var/log/biomaj -RUN mkdir -p /etc/biomaj/process.d -RUN mkdir -p /var/cache/biomaj -RUN mkdir -p /var/run/biomaj -COPY test-local/etc/biomaj/global_local.properties /etc/biomaj/global_local.properties -COPY test-local/etc/biomaj/conf.d/alu.properties /etc/biomaj/conf.d/alu.properties - -# Plugins -RUN cd /var/lib/biomaj && git clone https://github.com/genouest/biomaj-plugins.git plugins - -ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.6.0/wait /wait -RUN chmod +x /wait -COPY startup.sh /startup.sh diff --git a/docker-compose-otherdb.yml b/docker-compose-otherdb.yml index 958cdd3..ca5862b 100644 --- a/docker-compose-otherdb.yml +++ b/docker-compose-otherdb.yml @@ -28,7 +28,7 @@ - RABBITMQ_DEFAULT_PASS=biomaj biomaj-consul: - image: consul + image: hashicorp/consul:1.17 hostname: consulnode1 ports: - "8400:8400" diff --git a/docker-compose-traefik.yml b/docker-compose-traefik.yml index 1f1410c..7551465 100644 --- a/docker-compose-traefik.yml +++ b/docker-compose-traefik.yml @@ -50,7 +50,7 @@ - RABBITMQ_DEFAULT_PASS=biomaj biomaj-consul: - image: consul + image: hashicorp/consul:1.17 hostname: consulnode1 ports: - "8400:8400" diff --git a/docker-compose.yml b/docker-compose.yml index b15d3fa..6d6a5c1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,7 +28,7 @@ - RABBITMQ_DEFAULT_PASS=biomaj biomaj-consul: - image: consul + image: hashicorp/consul:1.17 hostname: consulnode1 ports: - "8400:8400" @@ -36,9 +36,8 @@ - "8600:53" command: agent -dev -client 0.0.0.0 -log-level info - biomaj-prometheus: - image: prom/prometheus:v1.8.2 + image: prom/prometheus:v2.45.6 ports: - "9090:9090" volumes: @@ -46,8 +45,8 @@ depends_on: - biomaj-consul command: - - '-storage.local.retention=720h' - - '-config.file=/etc/prometheus/prometheus.yml' + - '--storage.tsdb.retention.time=720h' + - '--config.file=/etc/prometheus/prometheus.yml' biomaj-influxdb: image: influxdb @@ -82,7 +81,7 @@ - biomaj-consul biomaj-user-web: - image: quay.io/osallou/biomaj + image: quay.io/genouest/biomaj build: context: . volumes: @@ -98,9 +97,8 @@ - biomaj-redis command: ["/startup.sh", "gunicorn", "-b", "0.0.0.0:5000", "--log-config", "/etc/biomaj/production.ini biomaj_user.wsgi:app"] - biomaj-download-web: - image: quay.io/osallou/biomaj + image: quay.io/genouest/biomaj build: context: . volumes: @@ -117,7 +115,7 @@ command: ["/startup.sh", "gunicorn", "-c", "/etc/biomaj/gunicorn_conf.py", "-b", "0.0.0.0:5000", "--log-config", "/etc/biomaj/production.ini biomaj_download.biomaj_download_web:app"] biomaj-download-message: - image: quay.io/osallou/biomaj + image: quay.io/genouest/biomaj build: context: . volumes: @@ -134,10 +132,10 @@ - biomaj-consul - biomaj-rabbitmq - biomaj-redis - command: ["/startup.sh", "python3", "/root/biomaj-download/bin/biomaj_download_consumer.py"] + command: ["/startup.sh", "biomaj_download_consumer.py"] biomaj-process-web: - image: quay.io/osallou/biomaj + image: quay.io/genouest/biomaj build: context: . volumes: @@ -155,7 +153,7 @@ command: ["/startup.sh", "gunicorn", "-c", "/etc/biomaj/gunicorn_conf.py", "-b", "0.0.0.0:5000", "--log-config", "/etc/biomaj/production.ini biomaj_process.biomaj_process_web:app"] biomaj-process-message: - image: quay.io/osallou/biomaj + image: quay.io/genouest/biomaj build: context: . volumes: @@ -175,10 +173,10 @@ - biomaj-rabbitmq - biomaj-redis - biomaj-elasticsearch - command: ["/startup.sh", "python3", "/root/biomaj-process/bin/biomaj_process_consumer.py"] + command: ["/startup.sh", "biomaj_process_consumer.py"] biomaj-daemon-web: - image: quay.io/osallou/biomaj + image: quay.io/genouest/biomaj build: context: . volumes: @@ -203,7 +201,7 @@ command: ["/startup.sh", "gunicorn", "-c", "/etc/biomaj/gunicorn_conf.py", "-b", "0.0.0.0:5000", "--log-config", "/etc/biomaj/production.ini biomaj_daemon.daemon.biomaj_daemon_web:app"] biomaj-daemon-message: - image: quay.io/osallou/biomaj + image: quay.io/genouest/biomaj build: context: . volumes: @@ -224,10 +222,10 @@ - biomaj-user-web - biomaj-download-web - biomaj-process-web - command: ["/startup.sh", "python3", "/root/biomaj-daemon/bin/biomaj_daemon_consumer.py"] + command: ["/startup.sh", "biomaj_daemon_consumer.py"] biomaj-watcher-web: - image: quay.io/osallou/biomaj + image: quay.io/genouest/biomaj build: context: . volumes: @@ -244,7 +242,7 @@ command: ["/startup.sh", "/root/watcher.sh"] biomaj-cron: - image: quay.io/osallou/biomaj-cron + image: quay.io/genouest/biomaj-cron volumes: - ${BIOMAJ_DIR}/biomaj:/var/lib/biomaj/data environment: @@ -253,7 +251,7 @@ - biomaj-daemon-web biomaj-ftp: - image: quay.io/osallou/biomaj + image: quay.io/genouest/biomaj build: context: . volumes: @@ -273,10 +271,10 @@ - biomaj-elasticsearch ports: - "2121:21" - command: ["/startup.sh", "python3", "/root/biomaj-ftp/bin/biomaj_ftp_service.py"] + command: ["/startup.sh", "biomaj_ftp_service.py"] biomaj-release-web: - image: quay.io/osallou/biomaj + image: quay.io/genouest/biomaj build: context: . volumes: @@ -291,10 +289,10 @@ - biomaj-redis - biomaj-daemon-web - biomaj-daemon-message - command: ["/startup.sh", "python3", "/root/biomaj-release/bin/biomaj_release.py"] + command: ["/startup.sh", "biomaj_release.py"] biomaj-expose: - image: quay.io/osallou/biomaj-expose + image: quay.io/genouest/biomaj-expose labels: - traefik.enable=true - traefik.frontend.rule=PathPrefix:/db @@ -305,6 +303,6 @@ build: context: proxy/nginx volumes: - - ${PWD}/proxy/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro + - ./proxy/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro - ${BIOMAJ_DIR}/biomaj/db:/db:ro command: [nginx-debug, '-g', 'daemon off;'] diff --git a/docker-test.sh b/docker-test.sh index 7f22721..009f6ed 100755 --- a/docker-test.sh +++ b/docker-test.sh @@ -5,20 +5,20 @@ set -e BANK=$1 TS=$(date +%s) USER="biomaj$TS" -docker-compose ps -APIKEY=`docker-compose exec biomaj-user-web biomaj-users.py -A add -E biomaj@fake.fr -U $USER -P biomaj --json | jq -r '.apikey'` +docker compose ps +APIKEY=`docker compose exec biomaj-user-web python3 /usr/local/bin/biomaj-users.py -A add -E biomaj@fake.fr -U $USER -P biomaj --json | jq -r '.apikey'` echo "APIKEY=$APIKEY" echo "update $BANK" -docker-compose exec biomaj-user-web biomaj-cli.py --proxy http://biomaj-public-proxy --api-key $APIKEY --update --bank $BANK +docker compose exec biomaj-user-web biomaj-cli.py --proxy http://biomaj-public-proxy --api-key $APIKEY --update --bank $BANK count=0 while true; do - docker-compose exec biomaj-user-web biomaj-cli.py --proxy http://biomaj-public-proxy --api-key $APIKEY --status --bank $BANK + docker compose exec biomaj-user-web biomaj-cli.py --proxy http://biomaj-public-proxy --api-key $APIKEY --status --bank $BANK sleep 60 echo "Check $BANK update status" - PROD=`docker-compose exec biomaj-user-web biomaj-cli.py --proxy http://biomaj-public-proxy --api-key $APIKEY --status --bank $BANK --json | jq '.bank.production.details[0]'` + PROD=`docker compose exec biomaj-user-web biomaj-cli.py --proxy http://biomaj-public-proxy --api-key $APIKEY --status --bank $BANK --json | jq '.bank.production.details[0]'` echo "PROD = $PROD" if [ "$PROD" == "null" ]; then echo "Not updated yet, trying again..." @@ -26,9 +26,9 @@ while true; do if test $count -eq 5 then echo "Still failing after 5 minutes" - docker-compose logs biomaj-daemon-message - docker-compose logs biomaj-download-web - docker-compose logs biomaj-download-message + docker compose logs biomaj-daemon-message + docker compose logs biomaj-download-web + docker compose logs biomaj-download-message exit 1 fi else @@ -36,5 +36,5 @@ while true; do break fi done -docker-compose exec biomaj-user-web biomaj-cli.py --proxy http://biomaj-public-proxy --api-key $APIKEY --status --bank $BANK +docker compose exec biomaj-user-web biomaj-cli.py --proxy http://biomaj-public-proxy --api-key $APIKEY --status --bank $BANK diff --git a/kubernetes/helm/templates/biomaj-consul.yml b/kubernetes/helm/templates/biomaj-consul.yml index dad6b1d..122a410 100644 --- a/kubernetes/helm/templates/biomaj-consul.yml +++ b/kubernetes/helm/templates/biomaj-consul.yml @@ -8,6 +8,6 @@ spec: hostname: consulnode1 containers: - name: biomaj-consul - image: consul + image: hashicorp/consul:1.17 command: ["consul"] args: ["agent", "-dev", "-client", "0.0.0.0", "-log-level", "info"]