diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1f1d0f6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,55 @@ +name: Test + +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: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build container + run: | + docker build -t chado . + + - name: Test Running Container + run: | + 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. + docker exec $container_id psql -U postgres -c "select * from organism where common_name = 'yeast' " | grep '1 row' + + # Dump something useful + 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 + + # Done! + exit 0 diff --git a/Dockerfile b/Dockerfile index c6ab1c6..7c023ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM postgres:9.5 +FROM postgres:16 ENV DEBIAN_FRONTEND=noninteractive \ CHADO_DB_NAME=postgres \ @@ -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-build2022-12-03/chado-1.31.sql.gz \ INSTALL_CHADO_SCHEMA=1 \ INSTALL_YEAST_DATA=0 @@ -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 && \ @@ -44,8 +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 + && 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..3cf8624 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,10 +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 + - @hexylena rebuilt with latest CSB data which is still quite old. - 2021-04-01 - @mboudet fixed the missing yeast genome - 2017-02-21