Commit 809beb20 authored by Robert Butora's avatar Robert Butora
Browse files

adds docker files

parent 849366ba
Loading
Loading
Loading
Loading

docker/Dockerfile.vlkb

0 → 100644
+68 −0
Original line number Diff line number Diff line
FROM debian:bullseye-slim
LABEL Description="vlkb tomcat9"

WORKDIR /root
ENV HOME /root


RUN apt -y update \
 && apt -y install sudo procps psmisc tree wget curl vim make build-essential checkinstall git \
                   libcfitsio-dev libpqxx-dev librabbitmq-dev libcsv-dev gfortran \
                   openjdk-17-jre-headless unzip \
                   rabbitmq-server openjdk-17-jre openjdk-17-jdk tomcat9 tomcat9-admin \
                   postgresql-client

COPY ast_9.2.9-1_amd64.deb ./
RUN dpkg -i /root/ast_9.2.9-1_amd64.deb && ldconfig \
 && mkdir -p /webapps/vlkb-search && mkdir -p /webapps/vlkb-cutout && mkdir /config \
 && mkdir -p /srv/surveys && mkdir -p /srv/cutouts

ARG VLKB_VERSION

COPY vlkb-${VLKB_VERSION}.deb vlkb-obscore-${VLKB_VERSION}.deb vlkbd-${VLKB_VERSION}.deb ./
COPY vlkb-search-${VLKB_VERSION}.war /webapps/vlkb-search/
COPY vlkb-cutout-${VLKB_VERSION}.war /webapps/vlkb-cutout/
RUN dpkg -i vlkb-${VLKB_VERSION}.deb vlkb-obscore-${VLKB_VERSION}.deb vlkbd-${VLKB_VERSION}.deb \
 && cd /webapps/vlkb-search && jar -xf vlkb-search-${VLKB_VERSION}.war \
 && cd /webapps/vlkb-cutout && jar -xf vlkb-cutout-${VLKB_VERSION}.war
 
COPY postgresql-*.jar  /var/lib/tomcat9/lib

# Lines with postgresql_*.jar: provide DB-driver so Tomcat loads it
# vlkb-search vlkb-cutout do not explicitely load DB-drivers



# configure instance

ENV INST_DIR=/usr/local

COPY vlkbd_exec.sh ${INST_DIR}/bin

RUN mkdir -p ${INST_DIR}/etc/vlkb-obscore \
 && mkdir -p ${INST_DIR}/etc/vlkbd \
 && echo "${INST_DIR}/lib" > /etc/ld.so.conf.d/ast.conf \
 && ldconfig

# configure during docker build-time

COPY config-vlkb/vlkb-obscore.datasets.conf ${INST_DIR}/etc/vlkb-obscore/datasets.conf
COPY config-vlkb/vlkbd.datasets.conf ${INST_DIR}/etc/vlkbd/datasets.conf

# created in entrypoint.sh COPY config-vlkb/servlet.cutout.properties /webapps/vlkb-cutout/WEB-INF/classes/cutout.properties

COPY config-vlkb/auth.properties config-vlkb/neatoken.properties config-vlkb/iamtoken.properties /webapps/vlkb-cutout/WEB-INF/classes/
COPY config-vlkb/auth.properties config-vlkb/neatoken.properties config-vlkb/iamtoken.properties config-vlkb/formatresponsefilter.properties /webapps/vlkb-search/WEB-INF/classes/

#COPY ssl/keystore.jks /root/
COPY ssl/server.xml ssl/server-connector-8080.xml ssl/server-connector-8443.xml /etc/tomcat9/

# configure during docker run-time

COPY entrypoint.sh /root

# run

RUN pwd && chmod +x /root/entrypoint.sh
CMD ["sh", "-c", "/root/entrypoint.sh"]

docker/Makefile

0 → 100644
+72 −0
Original line number Diff line number Diff line

VERSION ?= $(shell git describe)


all:


download-all: vlkb-search vlkb-cutout vlkbd vlkb-obscore vlkb

vlkb-search vlkb-cutout:
	make download PACK_FILE=$@-$(VERSION).war

vlkbd vlkb-obscore vlkb:
	make download PACK_FILE=$@-$(VERSION).rpm
	make download PACK_FILE=$@-$(VERSION).deb


.PHONY: download
download: GITLAB_PROJ_ID := 79
download: GITLAB_PROJ_NAME := $(shell basename -s .git `git config --get remote.origin.url`)
download: VER_MAJOR := $(shell echo $(VERSION) | cut -f1 -d.)
download: VER_MINOR := $(shell echo $(VERSION) | cut -f2 -d.)
download: PACK_URL := "https://ict.inaf.it/gitlab/api/v4/projects/$(GITLAB_PROJ_ID)/packages/generic/$(GITLAB_PROJ_NAME)/$(VER_MAJOR).$(VER_MINOR)/$(PACK_FILE)"
download:
	curl -O --header "PRIVATE-TOKEN: glpat-CJZDcks7bYqE__ePn4J6" $(PACK_URL)


ast-9.2.9.tar.gz:
	wget https://github.com/Starlink/ast/files/8843897/ast-9.2.9.tar.gz



.PHONY: build
build:
	docker build --build-arg VLKB_VERSION=$(VERSION) -t soda -f Dockerfile.vlkb .

# the docker-login below needed a ca-cert(?) which in the middle of the certificate-chain,
# but was not automatically downloaded and also local cert/ket pair(?) ->
# -> see: /etc/docker/certs.d/git.ia2.ianf.it:5050/*
#
# docker login git.ia2.inaf.it:5050 (robert.butora C-tol szokasos-hossu)
# to download: use image: ... in compose.yaml or
# docker run ... git.ia2.inaf.it:5050/vialactea/vlkb-soda

publish-locally-soda:
	docker tag soda git.ia2.inaf.it:5050/vialactea/vlkb-soda/soda:$(VERSION)
	docker push     git.ia2.inaf.it:5050/vialactea/vlkb-soda/soda:$(VERSION)
	docker image rm git.ia2.inaf.it:5050/vialactea/vlkb-soda/soda:$(VERSION)


##docker login registry.gitlab.com --> robert.butora xC*n
publish-remotely-to-ska:
	docker tag soda registry.gitlab.com/ska-telescope/src/visivo-vlkb-soda:$(VERSION)
	docker push     registry.gitlab.com/ska-telescope/src/visivo-vlkb-soda:$(VERSION)
	docker image rm registry.gitlab.com/ska-telescope/src/visivo-vlkb-soda:$(VERSION)

###############################################################################
#TAG ?= $(VERSION)
#REMOTE_SODA_IMAGE_NAME = registry.gitlab.com/ska-telescope/src/visivo-vlkb-soda:$(TAG)
#SODA_IMAGE_NAME = soda:$(TAG)
# https://gitlab.com/ska-telescope/src/visivo-vlkb-soda/container_registry/3917365
###############################################################################
#.PHONY: publish
#publish:
#	docker tag $(SODA_IMAGE_NAME) $(REMOTE_SODA_IMAGE_NAME)
#	docker push $(REMOTE_SODA_IMAGE_NAME)
#	docker image rm $(REMOTE_SODA_IMAGE_NAME)
#	@echo "SODA_IMAGE_NAME        : "$(SODA_IMAGE_NAME)
#	@echo "REMOTE_SODA_IMAGE_NAME : "$(REMOTE_SODA_IMAGE_NAME)
###############################################################################

+17.8 MiB

File added.

No diff preview for this file type.

+9.84 MiB

File added.

No diff preview for this file type.

+39 −0
Original line number Diff line number Diff line
version: '3'

services:

  ska:
    container_name: ska
    #image: git.ia2.inaf.it:5050/butora/vlkb-datasets/soda:latest
    image: registry.gitlab.com/ska-telescope/src/visivo-vlkb-soda:1.5.6
    #image: soda:latest
    ports:
      - 18019:8080
    environment:
      - SECURITY=
      - ACCESS_CONTEXT_ROOT=ska#datasets
      #- RESPONSE_FORMAT=application/fits
      #- RESPONSE_FORMAT=application/fits;createfile=yes
    volumes:
      - /srv/ska/surveys:/srv/surveys:z,ro
      - /srv/ska/cutouts:/srv/cutouts:z,rw
    restart: always


  ska-ssl:
    container_name: ska-ssl
    #image: git.ia2.inaf.it:5050/butora/vlkb-datasets/soda:latest
    image: registry.gitlab.com/ska-telescope/src/visivo-vlkb-soda:1.5.6
    #image: soda:latest
    ports:
      - 18025:8443
    environment:
      - SECURITY=iamtoken
      - ACCESS_CONTEXT_ROOT=ska#datasets
      #- RESPONSE_FORMAT=application/fits
      #- RESPONSE_FORMAT=application/fits;createfile=yes
    volumes:
      - /srv/ska/surveys:/srv/surveys:z,ro
      - /srv/ska/cutouts:/srv/cutouts:z,rw
    restart: always
Loading