Skip to content

Commit

Permalink
feat(docker): build a full image with all plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Nov 22, 2020
1 parent 87d81f8 commit ed15b4c
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 127 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore everything
**

# Allow docker directories
!docker/
53 changes: 45 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:
with:
node-version: '12'
check-latest: true

# Services
- name: Build the docker-compose stack
run: docker-compose -f docker-compose-ci.yml up -d

# Caches
# Caches
- name: Gradle cache
uses: actions/cache@v2
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
# Slack
- name: Slack notification
uses: 8398a7/action-slack@v3
if: always()
if: failure()
with:
status: ${{ job.status }}
job_name: Check
Expand All @@ -140,25 +140,62 @@ jobs:
steps:
- uses: actions/checkout@v2

# Artifact
- name: Download executable
uses: actions/download-artifact@v1
with:
name: exe

- name: Copy exe to image
run: cp exe/* docker/app/kestra && chmod +x docker/app/kestra
run: |
cp exe/* docker/app/kestra && chmod +x docker/app/kestra
- name: Publish to Docker Hub
uses: elgohr/Publish-Docker-Github-Action@master
# Vars
- name: Set image name
id: vars
run: |
TAG=${GITHUB_REF#refs/*/}
if [[ $TAG = "master" ]]
then
echo ::set-output name=tag::latest
else
echo ::set-output name=tag::${TAG}
fi
# Docker
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
name: kestra/kestra
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
tag_names: true

- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ format('kestra/kestra:{0}', steps.vars.outputs.tag) }}

- name: Push to Docker Hub Full
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ format('kestra/kestra:{0}-full', steps.vars.outputs.tag) }}
build-args: |
KESTRA_PLUGINS=org.kestra.storage.gcs:storage-gcs:LATEST org.kestra.storage.minio:storage-minio:LATEST org.kestra.task.aws:task-aws:LATEST org.kestra.task.gcp:task-gcp:LATEST org.kestra.task.kubernetes:task-kubernetes:LATEST org.kestra.task.serdes:task-serdes:LATEST org.kestra.task.notifications:task-notifications:LATEST org.kestra.task.crypto:task-crypto:LATEST org.kestra.task.jdbc:mysql:LATEST org.kestra.task.jdbc:postgres:LATEST
APT_PACKAGES=python3-pip python3-wheel python3-setuptools python3-virtualenv nodejs
# Slack
- name: Slack notification
uses: 8398a7/action-slack@v3
if: failure()
if: always()
with:
status: ${{ job.status }}
job_name: Publish docker
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ yarn.lock
### Docker
/.env
docker-compose*.overide.yml
docker/app/plugins/*.jar
docker/app/kestra
docker/app/confs/*.yml
docker/app/secrets/*.yml

### Build
core/src/main/resources/gradle.properties
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
FROM openjdk:11-jre-slim

ARG KESTRA_PLUGINS=""
ARG APT_PACKAGES=""

WORKDIR /app
COPY docker /

RUN if [ -n "${APT_PACKAGES}" ]; then apt-get update -y; apt-get install -y --no-install-recommends ${APT_PACKAGES}; apt-get clean && rm -rf /var/lib/apt/lists/* /var/tmp/*; fi && \
if [ -n "${KESTRA_PLUGINS}" ]; then /app/kestra plugins install ${KESTRA_PLUGINS}; fi


ENV MICRONAUT_CONFIG_FILES=/app/confs/application.yml

ENTRYPOINT ["docker-entrypoint.sh"]

CMD ["--help"]
84 changes: 0 additions & 84 deletions docker-compose-dev.yml

This file was deleted.

55 changes: 24 additions & 31 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ volumes:
driver: local
elasticsearch-data:
driver: local
kestra-data:
driver: local

services:
zookeeper:
Expand Down Expand Up @@ -46,40 +48,31 @@ services:
- elasticsearch-data:/usr/share/elasticsearch/data

kestra:
image: kestra/kestra:develop
image: kestra/kestra:develop-full
command: server standalone
volumes:
- kestra-data:/app/storage
environment:
MICRONAUT_APPLICATION_JSON: |
{
"kestra": {
"kafka": {
"client": {
"properties": {
"bootstrap.servers": "kafka:9092"
}
}
},
"elasticsearch": {
"client": {
"http-hosts": "http://elasticsearch:9200"
}
},
"repository": {
"type": "elasticsearch"
},
"storage": {
"type": "local",
"local": {
"base-path": "/tmp/kestra"
}
},
"queue": {
"type": "kafka"
}
}
}
KESTRA_CONFIGURATION: |
kestra:
kafka:
client:
properties:
bootstrap.servers: kafka:9092
elasticsearch:
client:
http-hosts: http://elasticsearch:9200
repository:
type: elasticsearch
storage:
type: local
local:
base-path: "/app/storage"
queue:
type: kafka
ports:
- 28080:8080
- 8080:8080
links:
- kafka
- zookeeper
Empty file added docker/app/plugins/.gitkeep
Empty file.
4 changes: 0 additions & 4 deletions docker/usr/local/bin/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@

set -e

if [ "${KESTRA_CONFIGURATION}" ]; then
echo "${KESTRA_CONFIGURATION}" > /app/confs/application.yml
fi

exec /app/kestra "$@"
8 changes: 8 additions & 0 deletions gradle/jar/selfrun.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ REM Plugins path default to pwd & must be exported as env var
SET "current_dir=%~dp0"
IF NOT DEFINED kestra_plugins_path (set "kestra_plugins_path=%current_dir%plugins\")

REM Kestra configuration env vars

IF NOT DEFINED kestra_configuration_path (set "kestra_configuration_path=%current_dir%confs\")

IF DEFINED kestra_configuration (
echo %kestra_configuration% > "%kestra_configuration_path%application.yml"
set "micronaut_config_files=%kestra_configuration_path%application.yml"
)

REM Check java version
FOR /f "delims=" %%w in ('java -fullversion 2^>^&1') do set java_fullversion=%%w
Expand Down
7 changes: 7 additions & 0 deletions gradle/jar/selfrun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
KESTRA_PLUGINS_PATH=${KESTRA_PLUGINS_PATH:-"$(dirname "$0")/plugins"}
export KESTRA_PLUGINS_PATH=${KESTRA_PLUGINS_PATH}

# Kestra configuration env vars
KESTRA_CONFIGURATION_PATH=${KESTRA_CONFIGURATION_PATH:-"$(dirname "$0")/confs"}
if [ "${KESTRA_CONFIGURATION}" ]; then
echo "${KESTRA_CONFIGURATION}" > "${KESTRA_CONFIGURATION_PATH}/application.yml"
export MICRONAUT_CONFIG_FILES="${KESTRA_CONFIGURATION_PATH}/application.yml"
fi

# Check java version
JAVA_FULLVERSION=$(java -fullversion 2>&1)
case "$JAVA_FULLVERSION" in
Expand Down

0 comments on commit ed15b4c

Please sign in to comment.