Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,38 @@ name: Docker Image CI

on:
push:
branches: [ "master" ]
branches: [ main, master ]
pull_request:
branches: [ "master" ]
branches: [ main, master ]

jobs:

build:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: |
docker build ./dockerfiles/dachs -f ./dockerfiles/dachs/Dockerfile -t gavodachs/dachs:$(date +%s)
- name: Checkout repository
uses: actions/checkout@v4

- name: Build Docker image
run: docker build -t dachs:test ./dockerfiles/dachs/

- name: Run Docker container
run: docker run --name dachs_container -dt dachs:test

- name: Verify container is running
run: docker ps | grep -q dachs_container

- name: Start dachs service
run: docker exec dachs_container /dachs.sh start

- name: Copy download script to container
run: docker cp data/download_arihip.sh dachs_container:/tmp/download.sh

- name: Download arihip data
run: docker exec dachs_container /tmp/download.sh arihip /var/gavo/inputs

- name: Import arihip data
run: docker exec dachs_container dachs imp -M 1000 arihip/q.rd

- name: Run all tests
run: docker exec dachs_container dachs test ALL
7 changes: 5 additions & 2 deletions dockerfiles/.env
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Local path for Dachs logs (persistence)
DACHS_LOGS_PATH="./tmp/logs"

# Base image (Debian, in DockerHub)
BASE_IMAGE="debian:trixie"

# Dachs branch/repository version.
# Options are: stable, backports, beta.
INSTALL_REPO=main
INSTALL_REPO="main"

# PostgreSQL version to build containers
PG_VERSION=15
PG_VERSION="15"
2 changes: 1 addition & 1 deletion dockerfiles/awstats/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM httpd:bullseye
FROM httpd:2.4

RUN DEBIAN_FRONTEND='noninteractive' && \
apt-get update && \
Expand Down
50 changes: 28 additions & 22 deletions dockerfiles/dachs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
FROM debian:bookworm
ARG BASE_IMAGE="debian:stable"

# BUILD argument for extra repositories (besides debian/stable) to install dachs.
# Options are:
# - "gavo/beta" (gavo/release + gavo/beta)
# - "backports" (debian/backports)
# - "main" (debian/main)
# * Default is "main"
ARG INSTALL_REPO="main"

# PostgreSQL version to install
# * Default is "15"
ARG PG_VERSION="15"

FROM $BASE_IMAGE

LABEL Description=DaCHS\ is\ a\ publishing\ infrastructure\ for\ the\ Virtual\ Observatory. \
Reference=http://arxiv.org/abs/1408.5733
Reference=http://arxiv.org/abs/1408.5733

# Everyday tools
RUN DEBIAN_FRONTEND='noninteractive' \
&& apt-get update \
&& apt-get install -y \
curl \
git \
gnupg2 \
locales \
procps \
sudo \
vim \
wget \
curl \
git \
gnupg2 \
locales \
procps \
sudo \
vim \
wget \
&& apt-get clean

# BUILD argument for extra repositories (besides debian/stable) to install dachs.
# Options are:
# - backports (debian/backports)
# - gavo/beta (gavo/release + gavo/beta)
# - main (debian/main)
# * If not defined, default is 'main'
ARG INSTALL_REPO="${INSTALL_REPO:-main}"

ENV _APT_SOURCES="/etc/apt/sources.list.d/gavo.list"
COPY etc/apt_sources.list "$_APT_SOURCES"

Expand All @@ -46,13 +52,13 @@ RUN curl https://vo.ari.uni-heidelberg.de/debian/gavo-archive-keyring.asc \

# If installing any version other than "main", backports is in there:
RUN [ "$INSTALL_REPO" != "main" ] \
&& sed -i '/deb.*backports/s/^#//' $_APT_SOURCES \
|| echo "NOT using debian/backports repo"
&& sed -i '/deb.*backports/s/^#//' $_APT_SOURCES \
|| echo "NOT using debian/backports repo"

# If installing -- i.e, "beta" version -- uncomment gavo's release and beta repos
RUN [ "$INSTALL_REPO" = "gavo/beta" -o "$INSTALL_REPO" = "latest" -o "$INSTALL_REPO" = "gavo" ] \
&& sed -i '/deb.*heidelberg/s/^#//' $_APT_SOURCES \
|| echo "NOT using gavo beta/release repos"
&& sed -i '/deb.*heidelberg/s/^#//' $_APT_SOURCES \
|| echo "NOT using gavo beta/release repos"

RUN echo "Using the following repositories:" && grep "deb" $_APT_SOURCES

Expand Down
54 changes: 30 additions & 24 deletions dockerfiles/dachs/Dockerfile.dachs_postgres
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
FROM debian:bookworm
ARG BASE_IMAGE="debian:stable"

# BUILD argument for extra repositories (besides debian/stable) to install dachs.
# Options are:
# - "gavo/beta" (gavo/release + gavo/beta)
# - "backports" (debian/backports)
# - "main" (debian/main)
# * Default is "main"
ARG INSTALL_REPO="main"

# PostgreSQL version to install
# * Default is "15"
ARG PG_VERSION="15"

FROM $BASE_IMAGE

LABEL Description=DaCHS\ is\ a\ publishing\ infrastructure\ for\ the\ Virtual\ Observatory. \
Reference=http://arxiv.org/abs/1408.5733
Reference=http://arxiv.org/abs/1408.5733

# Everyday tools
RUN DEBIAN_FRONTEND='noninteractive' \
&& apt-get update \
&& apt-get install -y \
curl \
git \
gnupg2 \
locales \
procps \
sudo \
vim \
wget \
curl \
git \
gnupg2 \
locales \
procps \
sudo \
vim \
wget \
&& apt-get clean

# BUILD argument for extra repositories (besides debian/stable) to install dachs.
# Options are:
# - backports (debian/backports)
# - gavo/beta (gavo/release + gavo/beta)
# - main (debian/main)
# * If not defined, default is 'main'
ARG INSTALL_REPO="${INSTALL_REPO:-main}"

ENV _APT_SOURCES="/etc/apt/sources.list.d/gavo.list"
COPY etc/apt_sources.list "$_APT_SOURCES"
Expand All @@ -46,17 +53,16 @@ RUN curl https://vo.ari.uni-heidelberg.de/debian/gavo-archive-keyring.asc \

# If installing any version other than "main", backports is in there:
RUN [ "$INSTALL_REPO" != "main" ] \
&& sed -i '/deb.*backports/s/^#//' $_APT_SOURCES \
|| echo "NOT using debian/backports repo"
&& sed -i '/deb.*backports/s/^#//' $_APT_SOURCES \
|| echo "NOT using debian/backports repo"

# If installing -- i.e, "beta" version -- uncomment gavo's release and beta repos
RUN [ "$INSTALL_REPO" = "gavo/beta" -o "$INSTALL_REPO" = "latest" -o "$INSTALL_REPO" = "gavo" ] \
&& sed -i '/deb.*heidelberg/s/^#//' $_APT_SOURCES \
|| echo "NOT using gavo beta/release repos"
&& sed -i '/deb.*heidelberg/s/^#//' $_APT_SOURCES \
|| echo "NOT using gavo beta/release repos"

RUN echo "Using the following repositories:" && grep "deb" $_APT_SOURCES

ARG PG_VERSION=15
ENV PG_VERSION=${PG_VERSION}

RUN DEBIAN_FRONTEND='noninteractive' && \
Expand All @@ -73,8 +79,8 @@ RUN PGFILE=/etc/postgresql/${PG_VERSION}/main/pg_hba.conf && \
RUN PGDATA=/var/lib/postgresql/${PG_VERSION} \
mkdir -p -m 777 /var/run/postgresql/${PG_VERSION}-main.pg_stat_tmp/ && \
su - postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/postgres \
-c config_file=/etc/postgresql/${PG_VERSION}/main/postgresql.conf \
-c logging_collector=on" & \
-c config_file=/etc/postgresql/${PG_VERSION}/main/postgresql.conf \
-c logging_collector=on" & \
sleep 5 && \
su postgres -c "createuser -s dachsroot" && \
su postgres -c "createuser -s root" && \
Expand Down
51 changes: 28 additions & 23 deletions dockerfiles/dachs/Dockerfile.dachs_server
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
FROM debian:bookworm
ARG BASE_IMAGE="debian:stable"

# BUILD argument for extra repositories (besides debian/stable) to install dachs.
# Options are:
# - "gavo/beta" (gavo/release + gavo/beta)
# - "backports" (debian/backports)
# - "main" (debian/main)
# * Default is "main"
ARG INSTALL_REPO="main"

# PostgreSQL version to install
# * Default is "15"
ARG PG_VERSION="15"

FROM $BASE_IMAGE

LABEL Description=DaCHS\ is\ a\ publishing\ infrastructure\ for\ the\ Virtual\ Observatory. \
Reference=http://arxiv.org/abs/1408.5733
Reference=http://arxiv.org/abs/1408.5733

# Everyday tools
RUN DEBIAN_FRONTEND='noninteractive' \
&& apt-get update \
&& apt-get install -y \
curl \
git \
gnupg2 \
locales \
procps \
sudo \
vim \
wget \
curl \
git \
gnupg2 \
locales \
procps \
sudo \
vim \
wget \
&& apt-get clean

# BUILD argument for extra repositories (besides debian/stable) to install dachs.
# Options are:
# - backports (debian/backports)
# - gavo/beta (gavo/release + gavo/beta)
# - main (debian/main)
# * If not defined, default is 'main'
ARG INSTALL_REPO="${INSTALL_REPO:-main}"

ENV _APT_SOURCES="/etc/apt/sources.list.d/gavo.list"
COPY etc/apt_sources.list "$_APT_SOURCES"

Expand All @@ -46,13 +52,13 @@ RUN curl https://vo.ari.uni-heidelberg.de/debian/gavo-archive-keyring.asc \

# If installing any version other than "main", backports is in there:
RUN [ "$INSTALL_REPO" != "main" ] \
&& sed -i '/deb.*backports/s/^#//' $_APT_SOURCES \
|| echo "NOT using debian/backports repo"
&& sed -i '/deb.*backports/s/^#//' $_APT_SOURCES \
|| echo "NOT using debian/backports repo"

# If installing -- i.e, "beta" version -- uncomment gavo's release and beta repos
RUN [ "$INSTALL_REPO" = "gavo/beta" -o "$INSTALL_REPO" = "latest" -o "$INSTALL_REPO" = "gavo" ] \
&& sed -i '/deb.*heidelberg/s/^#//' $_APT_SOURCES \
|| echo "NOT using gavo beta/release repos"
&& sed -i '/deb.*heidelberg/s/^#//' $_APT_SOURCES \
|| echo "NOT using gavo beta/release repos"

RUN echo "Using the following repositories:" && grep "deb" $_APT_SOURCES

Expand All @@ -62,7 +68,6 @@ ENV GAVO_INPUTS="${GAVO_ROOT}/inputs"
ENV GAVO_SETTINGS="/etc/gavo.rc"
ENV GAVOSETTINGS="$GAVO_SETTINGS"

ARG PG_VERSION=13
ENV PG_VERSION=${PG_VERSION}

# Install only the core of gavo and spatial extension to db
Expand Down
19 changes: 2 additions & 17 deletions dockerfiles/docker-compose.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
build:
context: ./dachs
args:
PG_VERSION: "${PG_VERSION:-15}"
PG_VERSION: "${PG_VERSION}"
image: dachs:postgres
container_name: postgres
tty: true
Expand All @@ -19,7 +19,7 @@ services:
dockerfile: Dockerfile.dachs_server
args:
INSTALL_REPO: "${INSTALL_REPO}"
PG_VERSION: "${PG_VERSION:-15}"
PG_VERSION: "${PG_VERSION}"
image: dachs:server
container_name: dachs
tty: true
Expand All @@ -32,18 +32,3 @@ services:
- 8080:8080
volumes:
- "${DACHS_LOGS_PATH:-./tmp/logs}:/var/gavo/logs"


# awstats:
# container_name: awstats
# image: dachs:awstats
# depends_on:
# - dachs
# build:
# context: ./awstats
# tty: true
# network_mode: 'bridge'
# ports:
# - 80:80
# volumes:
# - "${DACHS_LOGS_PATH:-./tmp/logs}:/var/gavo/logs:ro"
1 change: 1 addition & 0 deletions dockerfiles/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
context: ./dachs
dockerfile: Dockerfile
args:
BASE_IMAGE: "${BASE_IMAGE}"
INSTALL_REPO: "${INSTALL_REPO}"

container_name: dachs
Expand Down
Loading