From cb1f1d32f661a488ece18ff1cd45e9f6c8a33872 Mon Sep 17 00:00:00 2001 From: Helena Date: Thu, 22 Feb 2024 12:40:34 +0100 Subject: [PATCH 01/14] sed defined to enable running bulk load under modern perl --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c6ab1c6..0a0426b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ENV DEBIAN_FRONTEND=noninteractive \ POSTGRES_PASSWORD=postgres \ GMOD_ROOT=/usr/share/gmod/ \ PGDATA=/var/lib/postgresql/data/ \ - SCHEMA_URL=https://github.com/erasche/chado-schema-builder/releases/download/1.31-jenkins61/chado-1.31.sql.gz \ + SCHEMA_URL=https://github.com/galaxy-genome-annotation/chado-schema-builder/releases/download/1.31-jenkins61/chado-1.31.sql.gz \ INSTALL_CHADO_SCHEMA=1 \ INSTALL_YEAST_DATA=0 @@ -45,7 +45,8 @@ RUN mkdir -p $GMOD_ROOT $PGDATA && \ && cd / && tar xvfz /tmp/master.tar.gz \ && mv /Chado-master /chado \ && rm -f /tmp/master.tar.gz \ - && sed -i "s|listen_addresses=''|listen_addresses='localhost'|" /docker-entrypoint.sh + && sed -i "s|listen_addresses=''|listen_addresses='localhost'|" /docker-entrypoint.sh \ + && sed -i -r 's/defined\(@_\)/@_/g' /usr/local/share/perl/5.24.1/Bio/GMOD/DB/Adapter.pm WORKDIR /chado/chado/ # https://github.com/docker-library/postgres/blob/a82c28e1c407ef5ddfc2a6014dac87bcc4955a26/9.4/docker-entrypoint.sh#L85 From be8e3a31f7309ebdd1bf2f8bad84ae7e04e2b6f7 Mon Sep 17 00:00:00 2001 From: Helena Date: Thu, 22 Feb 2024 12:46:15 +0100 Subject: [PATCH 02/14] more modern schema yet --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0a0426b..ad8ffee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ENV DEBIAN_FRONTEND=noninteractive \ POSTGRES_PASSWORD=postgres \ GMOD_ROOT=/usr/share/gmod/ \ PGDATA=/var/lib/postgresql/data/ \ - SCHEMA_URL=https://github.com/galaxy-genome-annotation/chado-schema-builder/releases/download/1.31-jenkins61/chado-1.31.sql.gz \ + SCHEMA_URL=https://github.com/galaxy-genome-annotation/chado-schema-builder/releases/download/1.31-build2022-12-03/chado-1.31.sql.gz \ INSTALL_CHADO_SCHEMA=1 \ INSTALL_YEAST_DATA=0 From b11f7dad9069571b43fea258125dc34811d91046 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 22 Feb 2024 13:18:39 +0100 Subject: [PATCH 03/14] new postgres --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ad8ffee..8fa7053 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM postgres:9.5 +FROM postgres:16 ENV DEBIAN_FRONTEND=noninteractive \ CHADO_DB_NAME=postgres \ From c5fb8b67468945154e62902fc6c1989f9425d5ee Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 22 Feb 2024 13:18:53 +0100 Subject: [PATCH 04/14] work around new package names --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8fa7053..0d9fd5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,19 +18,18 @@ ENV DEBIAN_FRONTEND=noninteractive \ RUN apt-get -qq update && \ apt-get install --no-install-recommends -y build-essential \ libpng-dev zlib1g zlib1g-dev build-essential make libpq-dev curl \ - xsltproc netcat wget ca-certificates libperlio-gzip-perl \ + xsltproc wget ca-certificates libperlio-gzip-perl \ libcapture-tiny-perl libtest-differences-perl libperlio-gzip-perl \ libdevel-size-perl libdbi-perl libjson-perl libjson-xs-perl libheap-perl \ libhash-merge-perl libdbd-pg-perl libio-string-perl libtest-most-perl \ libarray-compare-perl libconvert-binary-c-perl libgraph-perl \ libgraphviz-perl libsoap-lite-perl libsvg-perl libsvg-graph-perl \ libset-scalar-perl libsort-naturally-perl libxml-sax-perl libxml-twig-perl \ - libxml-writer-perl libyaml-perl libgd2-xpm-dev perl-doc && \ + libxml-writer-perl libyaml-perl perl-doc libgd-dev nano vim-tiny netcat-openbsd && \ apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Some have to be forced. # But most install just fine -# Modifying /docker-entrypoint.sh because of https://github.com/docker-library/postgres/pull/440 RUN mkdir -p $GMOD_ROOT $PGDATA && \ curl -L http://cpanmin.us | perl - App::cpanminus && \ cpanm --force --notest Test::More Heap::Simple Heap::Simple::XS DBIx::DBStag GO::Parser && \ From f59d8fde63e2598c579e9ecfef58574c3d4e3af4 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 22 Feb 2024 13:19:18 +0100 Subject: [PATCH 05/14] yeast working again Fixes #11 --- Dockerfile | 11 +++++++---- README.md | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0d9fd5e..7c023ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,9 +43,7 @@ RUN mkdir -p $GMOD_ROOT $PGDATA && \ && wget https://github.com/GMOD/Chado/archive/master.tar.gz -O /tmp/master.tar.gz \ && cd / && tar xvfz /tmp/master.tar.gz \ && mv /Chado-master /chado \ - && rm -f /tmp/master.tar.gz \ - && sed -i "s|listen_addresses=''|listen_addresses='localhost'|" /docker-entrypoint.sh \ - && sed -i -r 's/defined\(@_\)/@_/g' /usr/local/share/perl/5.24.1/Bio/GMOD/DB/Adapter.pm + && rm -f /tmp/master.tar.gz WORKDIR /chado/chado/ # https://github.com/docker-library/postgres/blob/a82c28e1c407ef5ddfc2a6014dac87bcc4955a26/9.4/docker-entrypoint.sh#L85 @@ -57,7 +55,12 @@ RUN perl Makefile.PL GMOD_ROOT=/usr/share/gmod/ DEFAULTS=1 RECONFIGURE=1 && \ wget --quiet http://downloads.yeastgenome.org/curation/chromosomal_feature/saccharomyces_cerevisiae.gff.gz -O saccharomyces_cerevisiae.gff.gz && \ gunzip -c saccharomyces_cerevisiae.gff.gz > saccharomyces_cerevisiae.gff && \ sed -i s'/%20/ /g' saccharomyces_cerevisiae.gff && \ - chown -R postgres:postgres /chado/chado/ + chown -R postgres:postgres /chado/chado/ && \ + sed -i -r 's/defined\(@_\)/@_/g' /usr/local/share/perl/*/Bio/GMOD/DB/Adapter.pm && \ + sed -i "s|listen_addresses=''|listen_addresses='localhost'|" /usr/local/bin/docker-entrypoint.sh + +# The sed is required because the gmod_add_organism script assumes a network +# connection rather than socke. COPY load_schema.sh /docker-entrypoint-initdb.d/00-load_schema.sh COPY load_yeast.sh /docker-entrypoint-initdb.d/01-load_yeast.sh diff --git a/README.md b/README.md index 3a59965..30ef38a 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,8 @@ Given that I as the developer have no easy way to communicate to you as the end # Changelog +- 2024-02-22 + - @hexylena updated postgres from 9 to 16, and rebuilt with latest CSB data which is still quite old. - 2021-04-01 - @mboudet fixed the missing yeast genome - 2017-02-21 From 1564bb464c2e01d2b4c7c62b757947b33b0f6c1d Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 22 Feb 2024 13:21:26 +0100 Subject: [PATCH 06/14] add test case --- .github/workflows/test.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..cd73c8e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,12 @@ +name: Test +on: ["pull_request"] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build container + run: + docker build -t chado . From 05acddf7e197ac03a44e1714b9a8437143baf318 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 22 Feb 2024 13:27:46 +0100 Subject: [PATCH 07/14] est case --- .github/workflows/test.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cd73c8e..2b21ece 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,3 +10,21 @@ jobs: - name: Build container run: docker build -t chado . + + - name: Test Running Container + run: + docker run -n chado -it -e INSTALL_YEAST_DATA=1 chado & + + while true; do + # Check that it's ready to run + start_count=$(docker logs chado | grep 'database system is ready to accept connections' | wc -l) + if (( start_count > 1 )); then + break + fi + done + + # Check that yeast is, in fact loaded. + docker exec -it $(docker ps -q) psql -U postgres -c "select * from organism where common_name = 'yeast' " | grep '1 row' + + # Done! + exit 0 From 0ec69f99425c084e6bf8b8a52e2b676a99617e06 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 22 Feb 2024 13:28:44 +0100 Subject: [PATCH 08/14] fix yaml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b21ece..a173e80 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,11 +8,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Build container - run: + run: | docker build -t chado . - name: Test Running Container - run: + run: | docker run -n chado -it -e INSTALL_YEAST_DATA=1 chado & while true; do From 80a993d4e5442b114cee99cdb18793e9c97efa1f Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 22 Feb 2024 13:35:52 +0100 Subject: [PATCH 09/14] much better test case --- .github/workflows/test.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a173e80..021cd6d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,18 +13,24 @@ jobs: - name: Test Running Container run: | - docker run -n chado -it -e INSTALL_YEAST_DATA=1 chado & + container_id=$(docker run -it -e INSTALL_YEAST_DATA=1 -d --name chado chado) while true; do # Check that it's ready to run - start_count=$(docker logs chado | grep 'database system is ready to accept connections' | wc -l) + start_count=$(docker logs $container_id | grep 'database system is ready to accept connections' | wc -l) if (( start_count > 1 )); then break fi done # Check that yeast is, in fact loaded. - docker exec -it $(docker ps -q) psql -U postgres -c "select * from organism where common_name = 'yeast' " | grep '1 row' + docker exec -it $container_id psql -U postgres -c "select * from organism where common_name = 'yeast' " | grep '1 row' + + # Dump something useful + docker exec -it $container_id psql -U postgres -c "select type_id, count(*) from feature group by type_id ;" + + docker kill $container_id + docker rm -f $container_id # Done! exit 0 From b2bec47c0e9553423dcf697a16a9810000004526 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 22 Feb 2024 13:36:27 +0100 Subject: [PATCH 10/14] ok better better --- .github/workflows/test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 021cd6d..2120485 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,11 +16,19 @@ jobs: container_id=$(docker run -it -e INSTALL_YEAST_DATA=1 -d --name chado chado) while true; do + date + # Check that it's ready to run start_count=$(docker logs $container_id | grep 'database system is ready to accept connections' | wc -l) if (( start_count > 1 )); then break fi + + # If it's not output some logs + docker logs $container_id | tail + + # And wait a bit + sleep 5 done # Check that yeast is, in fact loaded. From 85acea94f1179af9ea15a1a667826de08d9ca7f4 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 22 Feb 2024 13:42:48 +0100 Subject: [PATCH 11/14] no it --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2120485..80048ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,10 +32,10 @@ jobs: done # Check that yeast is, in fact loaded. - docker exec -it $container_id psql -U postgres -c "select * from organism where common_name = 'yeast' " | grep '1 row' + docker exec $container_id psql -U postgres -c "select * from organism where common_name = 'yeast' " | grep '1 row' # Dump something useful - docker exec -it $container_id psql -U postgres -c "select type_id, count(*) from feature group by type_id ;" + docker exec $container_id psql -U postgres -c "select type_id, count(*) from feature group by type_id ;" docker kill $container_id docker rm -f $container_id From 536a06cff2a699ff1f8f4c28daac1ff6156924c1 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 22 Feb 2024 13:53:30 +0100 Subject: [PATCH 12/14] only run test cases when something useful changed --- .github/workflows/test.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 80048ee..1f1d0f6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,16 @@ name: Test -on: ["pull_request"] + +concurrency: + group: ci-${{ github.head_ref }} + cancel-in-progress: true + +on: + pull_request: + types: [opened, reopened, synchronize, ready_for_review] + paths: + - *.sh + - *.sql + - Dockerfile jobs: lint: From 6b7687fbdfeb3f12a7958890fa69874351ecc894 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 22 Feb 2024 13:55:04 +0100 Subject: [PATCH 13/14] cleanup readme --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 30ef38a..6f87483 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ -# Docker Chado Container [![Docker Repository on Quay](https://quay.io/repository/galaxy-genome-annotation/chado/status "Docker Repository on Quay")](https://quay.io/repository/galaxy-genome-annotation/chado) +# Docker Chado Container [![Docker Repository on Quay](https://quay.io/repository/galaxy-genome-annotation/chado/status "Docker Repository on Quay")](https://quay.io/repository/galaxy-genome-annotation/chado) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3540729.svg)](https://doi.org/10.5281/zenodo.3540729) -[![DOI](https://zenodo.org/badge/10899/erasche/docker-chado.svg)](https://zenodo.org/badge/latestdoi/10899/erasche/docker-chado) - -Built on top of a standard postgres:9.5 container, the Chado container provides the Chado schema loaded with all 5 standard ontologies. +Built on top of a standard postgres:16 container, the Chado container provides the Chado schema loaded with all 5 standard ontologies. ## Launching the Container @@ -56,7 +54,7 @@ docker run -d --name chado-yeast -e INSTALL_YEAST_DATA=1 quay.io/galaxy-genome-a ## Using the Container in `docker-compose.yml` -It is strongly, strongly recommended that you pin your images to a [specific tag](https://quay.io/repository/galaxy-genome-annotation/chado?tab=tags) of this repository. I have intentionally and unintentionally broken the `:latest` images before. +It is strongly, strongly recommended that you pin your images to a [specific tag](https://quay.io/repository/galaxy-genome-annotation/chado?tab=tags) of this repository. I have unintentionally broken the `:latest` images before. E.g. @@ -64,12 +62,13 @@ E.g. image: quay.io/galaxy-genome-annotation/chado:1.31-jenkins61-pg9.5 ``` -Given that I as the developer have no easy way to communicate to you as the end user that breaking changes have been made (and keeping backwards compatability is prohibitve for a 1-person team..., sorry!), it is best to pin and read the changelog before upgrading. +Given that we, as the developers, have no easy way to communicate to you as the end user that breaking changes have been made (and keeping backwards compatability is prohibitve for a small team..., sorry!), it is best to pin and read the changelog before upgrading. # Changelog - 2024-02-22 - - @hexylena updated postgres from 9 to 16, and rebuilt with latest CSB data which is still quite old. + - @hexylena updated postgres from 9 to 16 + - @hexylena rebuilt with latest CSB data which is still quite old. - 2021-04-01 - @mboudet fixed the missing yeast genome - 2017-02-21 From 7c51385fd331014a89d59e2a47495b1ffcdf1d39 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Fri, 23 Feb 2024 09:32:07 +0100 Subject: [PATCH 14/14] doh --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6f87483..3cf8624 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Given that we, as the developers, have no easy way to communicate to you as the - 2024-02-22 - @hexylena updated postgres from 9 to 16 - - @hexylena rebuilt with latest CSB data which is still quite old. + - @hexylena rebuilt with latest CSB data which is still quite old. - 2021-04-01 - @mboudet fixed the missing yeast genome - 2017-02-21