Skip to content

Commit

Permalink
Merge pull request #332 from ARTbio/xenial_1805-09
Browse files Browse the repository at this point in the history
Xenial / 1805 for test environments and for docker builds
  • Loading branch information
drosofff authored Jan 5, 2019
2 parents c28fe32 + c8a168b commit 0967945
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
python: 2.7
dist: trusty
dist: xenial
sudo: required

env:
Expand Down
22 changes: 13 additions & 9 deletions Dockerfile.galaxykickstart-base
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
FROM artbio/ansible-galaxy-os
FROM artbio/ansible-galaxy-os:1604

LABEL multi.maintainer_1="Marius van den Beek <[email protected]>" \
multi.maintainer_2="Christophe Antoniewski <[email protected]>"
LABEL maintainer_2="Christophe Antoniewski <[email protected]>"

RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
\
\
echo "===> Allow start of services" && \
echo "exit 0" > /usr/sbin/policy-rc.d && \
\
apt-get install -y --no-install-recommends \
apt-get install -qq --no-install-recommends \
apt-transport-https software-properties-common

RUN apt-get install sudo -o Dpkg::Options::="--force-confold"

ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
echo "===> Updating TLS certificates..." && \
apt-get install -y openssl ca-certificates

COPY . /setup
WORKDIR /setup

RUN sed -i -e 's/^# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen

ENV LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8
LANG=en_US.UTF-8

RUN locale-gen en_US.UTF-8 && dpkg-reconfigure locales
# work around for AUFS bug
# as per https://github.com/docker/docker/issues/783#issuecomment-56013588
RUN mkdir /etc/ssl/private-copy /var/lib/postgresql-copy && \
Expand All @@ -31,12 +33,15 @@ RUN mkdir /etc/ssl/private-copy /var/lib/postgresql-copy && \
rm -R /var/lib/postgresql /etc/ssl/private/ && \
mv /var/lib/postgresql-copy /var/lib/postgresql && \
mv /etc/ssl/private-copy /etc/ssl/private && \
chmod 0700 /var/lib/postgresql /etc/ssl/private && \
chmod -R 0700 /var/lib/postgresql /etc/ssl/private && \
chown -R 1550:1550 /var/lib/postgresql /var/run/postgresql \
/var/log/postgresql /etc/ssl/private /etc/postgresql

RUN echo $(ansible --version)
RUN echo 'root ALL=(ALL:ALL) ALL' >> /etc/sudoers && echo 'postgres ALL=(ALL:ALL) ALL' >> /etc/sudoers
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# Warning: The following requirements pull down requires an ansible-galaxy-os compatible with ubuntu-xenial and postgresql 9.5
# see for instance https://github.com/ARTbio/ansible-galaxy-os/tree/ubuntu-xenial, if not already merged
RUN ansible-galaxy install -r requirements_roles.yml -p roles -f && \
ansible-playbook -i inventory_files/docker -c local galaxy.yml

Expand All @@ -46,7 +51,6 @@ NAT_MASQUERADE=false

ONBUILD WORKDIR /setup
ONBUILD COPY . /setup

ADD startup.sh /startup.sh
RUN chmod +x /startup.sh

Expand Down
4 changes: 2 additions & 2 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
- include_tasks: roles/handlers/galaxy.yml

pre_tasks:
- fail: msg="Installed ansible version {{ ansible_version.full }}, but ansible version >= 2.4 required"
when: ansible_version.full | version_compare('2.4.0.0', '<')
- fail: msg="Installed ansible version {{ ansible_version.full }}, but ansible version >= 2.7 required"
when: ansible_version.full is version_compare('2.7', '<')
tags:
- always

Expand Down
2 changes: 1 addition & 1 deletion requirements_roles.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- src: https://github.com/ARTbio/ansible-galaxy-os.git
name: galaxyprojectdotorg.galaxy-os
version: galaxykickstart
version: ubuntu-xenial

- src: https://github.com/ARTbio/ensure_postgresql_up.git
name: ensure_postgresql_up
Expand Down
6 changes: 3 additions & 3 deletions travis_scripts/before_install_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
set -e
docker --version
docker info
ansible-galaxy install -r requirements_roles.yml -p roles
ansible-galaxy install -r requirements_roles.yml -p roles -f
sudo groupadd -r $GALAXY_TRAVIS_USER -g $GALAXY_GID
sudo useradd -u $GALAXY_UID -r -g $GALAXY_TRAVIS_USER -d $GALAXY_HOME -p travis_testing\
sudo useradd -u $GALAXY_UID -r -g $GALAXY_TRAVIS_USER -d $GALAXY_HOME -p travis_testing \
-c "Galaxy user" $GALAXY_TRAVIS_USER
sudo mkdir $GALAXY_HOME
sudo chown -R $GALAXY_TRAVIS_USER:$GALAXY_TRAVIS_USER $GALAXY_HOME
docker build -t galaxy_kickstart -f Dockerfile.galaxykickstart-base .
sudo mkdir /export && sudo chown $GALAXY_UID:$GALAXY_GID /export
sudo mkdir /export2 && sudo chown $GALAXY_UID:$GALAXY_GID /export2
export CID1=`docker run -d --privileged=true -p 80:80 -p 21:21\
export CID1=`docker run -d --privileged=true -p 80:80 -p 21:21 \
-e NAT_MASQUERADE=true \
-e NGINX_GALAXY_LOCATION=/subdir \
-v /tmp/:/tmp/ \
Expand Down
2 changes: 1 addition & 1 deletion travis_scripts/script_docker.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e
echo -e "sleeping 120s, zzzzzz"
sleep 180s
sleep 120s
docker logs $CID1
echo -e "Testing CID1 $CID1"
curl http://localhost:80/subdir/api/version| grep version_major
Expand Down

0 comments on commit 0967945

Please sign in to comment.