mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-19 18:05:41 -05:00
feat(docker): build a full image with all plugins
This commit is contained in:
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Ignore everything
|
||||||
|
**
|
||||||
|
|
||||||
|
# Allow docker directories
|
||||||
|
!docker/
|
||||||
55
.github/workflows/main.yml
vendored
55
.github/workflows/main.yml
vendored
@@ -39,11 +39,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: '12'
|
node-version: '12'
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
# Services
|
# Services
|
||||||
- name: Build the docker-compose stack
|
- name: Build the docker-compose stack
|
||||||
run: docker-compose -f docker-compose-ci.yml up -d
|
run: docker-compose -f docker-compose-ci.yml up -d
|
||||||
|
|
||||||
# Caches
|
|
||||||
# Caches
|
# Caches
|
||||||
- name: Gradle cache
|
- name: Gradle cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
@@ -119,7 +119,7 @@ jobs:
|
|||||||
# Slack
|
# Slack
|
||||||
- name: Slack notification
|
- name: Slack notification
|
||||||
uses: 8398a7/action-slack@v3
|
uses: 8398a7/action-slack@v3
|
||||||
if: always()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
status: ${{ job.status }}
|
status: ${{ job.status }}
|
||||||
job_name: Check
|
job_name: Check
|
||||||
@@ -140,25 +140,62 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Artifact
|
||||||
- name: Download executable
|
- name: Download executable
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: exe
|
name: exe
|
||||||
- name: Copy exe to image
|
|
||||||
run: cp exe/* docker/app/kestra && chmod +x docker/app/kestra
|
|
||||||
|
|
||||||
- name: Publish to Docker Hub
|
- name: Copy exe to image
|
||||||
uses: elgohr/Publish-Docker-Github-Action@master
|
run: |
|
||||||
|
cp exe/* docker/app/kestra && chmod +x docker/app/kestra
|
||||||
|
|
||||||
|
# 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:
|
with:
|
||||||
name: kestra/kestra
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
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
|
# Slack
|
||||||
- name: Slack notification
|
- name: Slack notification
|
||||||
uses: 8398a7/action-slack@v3
|
uses: 8398a7/action-slack@v3
|
||||||
if: failure()
|
if: always()
|
||||||
with:
|
with:
|
||||||
status: ${{ job.status }}
|
status: ${{ job.status }}
|
||||||
job_name: Publish docker
|
job_name: Publish docker
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -35,6 +35,10 @@ yarn.lock
|
|||||||
### Docker
|
### Docker
|
||||||
/.env
|
/.env
|
||||||
docker-compose*.overide.yml
|
docker-compose*.overide.yml
|
||||||
|
docker/app/plugins/*.jar
|
||||||
|
docker/app/kestra
|
||||||
|
docker/app/confs/*.yml
|
||||||
|
docker/app/secrets/*.yml
|
||||||
|
|
||||||
### Build
|
### Build
|
||||||
core/src/main/resources/gradle.properties
|
core/src/main/resources/gradle.properties
|
||||||
10
Dockerfile
10
Dockerfile
@@ -1,7 +1,17 @@
|
|||||||
FROM openjdk:11-jre-slim
|
FROM openjdk:11-jre-slim
|
||||||
|
|
||||||
|
ARG KESTRA_PLUGINS=""
|
||||||
|
ARG APT_PACKAGES=""
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY docker /
|
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
|
ENV MICRONAUT_CONFIG_FILES=/app/confs/application.yml
|
||||||
|
|
||||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||||
|
|
||||||
CMD ["--help"]
|
CMD ["--help"]
|
||||||
|
|||||||
@@ -1,84 +0,0 @@
|
|||||||
version: "3.6"
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
zookeeper-data:
|
|
||||||
driver: local
|
|
||||||
zookeeper-log:
|
|
||||||
driver: local
|
|
||||||
kafka-data:
|
|
||||||
driver: local
|
|
||||||
elasticsearch-data:
|
|
||||||
driver: local
|
|
||||||
|
|
||||||
networks:
|
|
||||||
kestra: {}
|
|
||||||
|
|
||||||
services:
|
|
||||||
zookeeper:
|
|
||||||
image: confluentinc/cp-zookeeper
|
|
||||||
volumes:
|
|
||||||
- zookeeper-data:/var/lib/zookeeper/data
|
|
||||||
- zookeeper-log:/var/lib/zookeeper/log
|
|
||||||
environment:
|
|
||||||
ZOOKEEPER_CLIENT_PORT: 2181
|
|
||||||
networks:
|
|
||||||
- kestra
|
|
||||||
|
|
||||||
kafka:
|
|
||||||
image: confluentinc/cp-kafka
|
|
||||||
volumes:
|
|
||||||
- kafka-data:/var/lib/kafka
|
|
||||||
environment:
|
|
||||||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
|
||||||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
|
|
||||||
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
|
|
||||||
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
|
|
||||||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kestra:9092
|
|
||||||
KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE: 'false'
|
|
||||||
links:
|
|
||||||
- zookeeper
|
|
||||||
ports:
|
|
||||||
- 127.8.9.13:9092:9092
|
|
||||||
networks:
|
|
||||||
kestra:
|
|
||||||
aliases:
|
|
||||||
- kestra
|
|
||||||
|
|
||||||
elasticsearch:
|
|
||||||
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.2
|
|
||||||
environment:
|
|
||||||
discovery.type: single-node
|
|
||||||
ES_JAVA_OPTS: "-Xms256m -Xmx256m"
|
|
||||||
ulimits:
|
|
||||||
memlock:
|
|
||||||
soft: -1
|
|
||||||
hard: -1
|
|
||||||
volumes:
|
|
||||||
- elasticsearch-data:/usr/share/elasticsearch/data
|
|
||||||
ports:
|
|
||||||
- 127.8.9.13:9200:9200
|
|
||||||
networks:
|
|
||||||
- kestra
|
|
||||||
|
|
||||||
kibana:
|
|
||||||
image: docker.elastic.co/kibana/kibana:7.4.2
|
|
||||||
environment:
|
|
||||||
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
|
|
||||||
ports:
|
|
||||||
- 127.8.9.13:5601:5601
|
|
||||||
networks:
|
|
||||||
- kestra
|
|
||||||
|
|
||||||
akhq:
|
|
||||||
image: tchiotludo/akhq
|
|
||||||
environment:
|
|
||||||
AKHQ_CONFIGURATION: |
|
|
||||||
kafkahq:
|
|
||||||
connections:
|
|
||||||
local:
|
|
||||||
properties:
|
|
||||||
bootstrap.servers: "kestra:9092"
|
|
||||||
ports:
|
|
||||||
- 127.8.9.13:28080:8080
|
|
||||||
networks:
|
|
||||||
- kestra
|
|
||||||
@@ -9,6 +9,8 @@ volumes:
|
|||||||
driver: local
|
driver: local
|
||||||
elasticsearch-data:
|
elasticsearch-data:
|
||||||
driver: local
|
driver: local
|
||||||
|
kestra-data:
|
||||||
|
driver: local
|
||||||
|
|
||||||
services:
|
services:
|
||||||
zookeeper:
|
zookeeper:
|
||||||
@@ -46,40 +48,31 @@ services:
|
|||||||
- elasticsearch-data:/usr/share/elasticsearch/data
|
- elasticsearch-data:/usr/share/elasticsearch/data
|
||||||
|
|
||||||
kestra:
|
kestra:
|
||||||
image: kestra/kestra:develop
|
image: kestra/kestra:develop-full
|
||||||
command: server standalone
|
command: server standalone
|
||||||
|
volumes:
|
||||||
|
- kestra-data:/app/storage
|
||||||
environment:
|
environment:
|
||||||
MICRONAUT_APPLICATION_JSON: |
|
KESTRA_CONFIGURATION: |
|
||||||
{
|
kestra:
|
||||||
"kestra": {
|
kafka:
|
||||||
"kafka": {
|
client:
|
||||||
"client": {
|
properties:
|
||||||
"properties": {
|
bootstrap.servers: kafka:9092
|
||||||
"bootstrap.servers": "kafka:9092"
|
elasticsearch:
|
||||||
}
|
client:
|
||||||
}
|
http-hosts: http://elasticsearch:9200
|
||||||
},
|
repository:
|
||||||
"elasticsearch": {
|
type: elasticsearch
|
||||||
"client": {
|
storage:
|
||||||
"http-hosts": "http://elasticsearch:9200"
|
type: local
|
||||||
}
|
local:
|
||||||
},
|
base-path: "/app/storage"
|
||||||
"repository": {
|
queue:
|
||||||
"type": "elasticsearch"
|
type: kafka
|
||||||
},
|
|
||||||
"storage": {
|
|
||||||
"type": "local",
|
|
||||||
"local": {
|
|
||||||
"base-path": "/tmp/kestra"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"queue": {
|
|
||||||
"type": "kafka"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ports:
|
ports:
|
||||||
- 28080:8080
|
- 8080:8080
|
||||||
links:
|
links:
|
||||||
- kafka
|
- kafka
|
||||||
- zookeeper
|
- zookeeper
|
||||||
|
|||||||
0
docker/app/plugins/.gitkeep
Normal file
0
docker/app/plugins/.gitkeep
Normal file
@@ -2,8 +2,4 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ "${KESTRA_CONFIGURATION}" ]; then
|
|
||||||
echo "${KESTRA_CONFIGURATION}" > /app/confs/application.yml
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec /app/kestra "$@"
|
exec /app/kestra "$@"
|
||||||
|
|||||||
@@ -13,6 +13,14 @@ REM Plugins path default to pwd & must be exported as env var
|
|||||||
SET "current_dir=%~dp0"
|
SET "current_dir=%~dp0"
|
||||||
IF NOT DEFINED kestra_plugins_path (set "kestra_plugins_path=%current_dir%plugins\")
|
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
|
REM Check java version
|
||||||
FOR /f "delims=" %%w in ('java -fullversion 2^>^&1') do set java_fullversion=%%w
|
FOR /f "delims=" %%w in ('java -fullversion 2^>^&1') do set java_fullversion=%%w
|
||||||
|
|||||||
@@ -2,6 +2,13 @@
|
|||||||
KESTRA_PLUGINS_PATH=${KESTRA_PLUGINS_PATH:-"$(dirname "$0")/plugins"}
|
KESTRA_PLUGINS_PATH=${KESTRA_PLUGINS_PATH:-"$(dirname "$0")/plugins"}
|
||||||
export KESTRA_PLUGINS_PATH=${KESTRA_PLUGINS_PATH}
|
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
|
# Check java version
|
||||||
JAVA_FULLVERSION=$(java -fullversion 2>&1)
|
JAVA_FULLVERSION=$(java -fullversion 2>&1)
|
||||||
case "$JAVA_FULLVERSION" in
|
case "$JAVA_FULLVERSION" in
|
||||||
|
|||||||
Reference in New Issue
Block a user