Skip to content

Commit

Permalink
feat(docker): load some examples flow on docker-compose startup
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Mar 8, 2022
1 parent 054bf23 commit 91e2f5a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ jobs:
platforms: linux/amd64,linux/arm64
build-args: |
KESTRA_PLUGINS=${{ steps.vars.outputs.plugins }} io.kestra.storage:storage-gcs:LATEST io.kestra.storage:storage-minio:LATEST io.kestra.plugin:plugin-aws:LATEST io.kestra.plugin:plugin-compress:LATEST io.kestra.plugin:plugin-crypto:LATEST io.kestra.plugin:plugin-elasticsearch:LATEST io.kestra.plugin:plugin-fs:LATEST io.kestra.plugin:plugin-gcp:LATEST io.kestra.plugin:plugin-googleworkspace:LATEST io.kestra.plugin:plugin-jdbc-clickhouse:LATEST io.kestra.plugin:plugin-jdbc-mysql:LATEST io.kestra.plugin:plugin-jdbc-oracle:LATEST io.kestra.plugin:plugin-jdbc-postgres:LATEST io.kestra.plugin:plugin-jdbc-redshift:LATEST io.kestra.plugin:plugin-jdbc-sqlserver:LATEST io.kestra.plugin:plugin-jdbc-vertica:LATEST io.kestra.plugin:plugin-jdbc-vectorwise:LATEST io.kestra.plugin:plugin-kafka:LATEST io.kestra.plugin:plugin-kubernetes:LATEST io.kestra.plugin:plugin-mongodb:LATEST io.kestra.plugin:plugin-notifications:LATEST io.kestra.plugin:plugin-script-groovy:LATEST io.kestra.plugin:plugin-script-jython:LATEST io.kestra.plugin:plugin-script-nashorn:LATEST io.kestra.plugin:plugin-serdes:LATEST io.kestra.plugin:plugin-singer:LATEST
APT_PACKAGES=python3-pip python3-wheel python3-setuptools python3-virtualenv nodejs
APT_PACKAGES=python3-pip python3-wheel python3-setuptools python3-virtualenv nodejs curl wait-for-it zip unzip
# GitHub Release
- name: Create GitHub release
Expand Down
9 changes: 2 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ ARG APT_PACKAGES=""
WORKDIR /app
COPY docker /

RUN mkdir -p /app/plugins && \
apt-get update -y && \
apt-get install -y --no-install-recommends curl wait-for-it ${APT_PACKAGES} && \
apt-get upgrade -y && \
apt-get clean && rm -rf /var/lib/apt/lists/* /var/tmp/*

RUN if [ -n "${KESTRA_PLUGINS}" ]; then /app/kestra plugins install ${KESTRA_PLUGINS}; fi
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

ENTRYPOINT ["docker-entrypoint.sh"]

Expand Down
20 changes: 15 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,24 @@ services:

kestra:
image: kestra/kestra:develop-full
# build:
# context: .
# args:
# KESTRA_PLUGINS: --repositories=https://s01.oss.sonatype.org/content/repositories/snapshots io.kestra.storage:storage-gcs:LATEST io.kestra.storage:storage-minio:LATEST io.kestra.plugin:plugin-aws:LATEST io.kestra.plugin:plugin-compress:LATEST io.kestra.plugin:plugin-crypto:LATEST io.kestra.plugin:plugin-elasticsearch:LATEST io.kestra.plugin:plugin-fs:LATEST io.kestra.plugin:plugin-gcp:LATEST io.kestra.plugin:plugin-googleworkspace:LATEST io.kestra.plugin:plugin-jdbc-clickhouse:LATEST io.kestra.plugin:plugin-jdbc-mysql:LATEST io.kestra.plugin:plugin-jdbc-oracle:LATEST io.kestra.plugin:plugin-jdbc-postgres:LATEST io.kestra.plugin:plugin-jdbc-redshift:LATEST io.kestra.plugin:plugin-jdbc-sqlserver:LATEST io.kestra.plugin:plugin-jdbc-vertica:LATEST io.kestra.plugin:plugin-jdbc-vectorwise:LATEST io.kestra.plugin:plugin-kafka:LATEST io.kestra.plugin:plugin-kubernetes:LATEST io.kestra.plugin:plugin-mongodb:LATEST io.kestra.plugin:plugin-notifications:LATEST io.kestra.plugin:plugin-script-groovy:LATEST io.kestra.plugin:plugin-script-jython:LATEST io.kestra.plugin:plugin-script-nashorn:LATEST io.kestra.plugin:plugin-serdes:LATEST io.kestra.plugin:plugin-singer:LATEST
# APT_PACKAGES: curl wait-for-it zip unzip
entrypoint: /bin/bash
command:
- -c
- "/usr/bin/wait-for-it -t 60 kafka:9092 && /usr/bin/wait-for-it -t 60 elasticsearch:9200 && /app/kestra server standalone"
- |
/usr/bin/wait-for-it -t 60 kafka:9092 && \
/usr/bin/wait-for-it -t 60 elasticsearch:9200 && \
curl -s -o /tmp/examples.zip https://kestra.io/examples.zip && \
unzip -o -d /tmp/examples /tmp/examples.zip > /dev/null && \
/app/kestra server standalone --flow-path=/tmp/examples
volumes:
- kestra-data:/app/storage
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/kestra:/tmp/kestra
- /tmp/kestra-wd:/tmp/kestra-wd
environment:
KESTRA_CONFIGURATION: |
kestra:
Expand All @@ -71,7 +81,7 @@ services:
defaults:
stream:
properties:
state.dir: "/tmp/kestra/kafka-streams/"
state.dir: "/tmp/kestra-wd/kafka-streams/"
elasticsearch:
client:
http-hosts: http://elasticsearch:9200
Expand All @@ -85,10 +95,10 @@ services:
type: kafka
tasks:
tmp-dir:
path: /tmp/kestra/tmp
path: /tmp/kestra-wd/tmp
url: http://localhost:8080/
ports:
- "8080:8080"
- "28080:8080"
depends_on:
- kafka
- zookeeper
Expand Down

0 comments on commit 91e2f5a

Please sign in to comment.