Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Data Logistics Service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eFlows4HPC WP2
Data Logistics Service
Commits
7c64efba
Commit
7c64efba
authored
3 years ago
by
Jedrzej Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
inistal commit of dockers, basic all-in-one setup
parent
33896ac4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dockers/docker-compose.yaml
+153
-0
153 additions, 0 deletions
dockers/docker-compose.yaml
dockers/install.md
+26
-0
26 additions, 0 deletions
dockers/install.md
with
179 additions
and
0 deletions
dockers/docker-compose.yaml
0 → 100644
+
153
−
0
View file @
7c64efba
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Basic Airflow cluster configuration for CeleryExecutor with Redis and PostgreSQL.
#
# WARNING: This configuration is for local development. Do not use it in a production deployment.
#
# This configuration supports basic configuration using environment variables or an .env file
# The following variables are supported:
#
# AIRFLOW_IMAGE_NAME - Docker image name used to run Airflow.
# Default: apache/airflow:master-python3.8
# AIRFLOW_UID - User ID in Airflow containers
# Default: 50000
# AIRFLOW_GID - Group ID in Airflow containers
# Default: 50000
#
# Those configurations are useful mostly in case of standalone testing/running Airflow in test/try-out mode
#
# _AIRFLOW_WWW_USER_USERNAME - Username for the administrator account (if requested).
# Default: airflow
# _AIRFLOW_WWW_USER_PASSWORD - Password for the administrator account (if requested).
# Default: airflow
# _PIP_ADDITIONAL_REQUIREMENTS - Additional PIP requirements to add when starting all containers.
# Default: ''
#
# Feel free to modify this file to suit your needs.
---
version
:
'
2.4'
x-airflow-common
:
&airflow-common
image
:
${AIRFLOW_IMAGE_NAME:-apache/airflow:2.1.2}
environment
:
&airflow-common-env
AIRFLOW__CORE__EXECUTOR
:
CeleryExecutor
AIRFLOW__CORE__SQL_ALCHEMY_CONN
:
postgresql+psycopg2://airflow:airflow@postgres/airflow
AIRFLOW__CELERY__RESULT_BACKEND
:
db+postgresql://airflow:airflow@postgres/airflow
AIRFLOW__CELERY__BROKER_URL
:
redis://:@redis:6379/0
AIRFLOW__CORE__FERNET_KEY
:
'
'
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION
:
'
true'
AIRFLOW__CORE__LOAD_EXAMPLES
:
'
true'
AIRFLOW__API__AUTH_BACKEND
:
'
airflow.api.auth.backend.basic_auth'
_PIP_ADDITIONAL_REQUIREMENTS
:
${_PIP_ADDITIONAL_REQUIREMENTS:-}
volumes
:
-
./dags:/opt/airflow/dags
-
./logs:/opt/airflow/logs
-
./plugins:/opt/airflow/plugins
user
:
"
${AIRFLOW_UID:-50000}:${AIRFLOW_GID:-50000}"
depends_on
:
redis
:
condition
:
service_healthy
postgres
:
condition
:
service_healthy
services
:
postgres
:
image
:
postgres:13
environment
:
POSTGRES_USER
:
airflow
POSTGRES_PASSWORD
:
airflow
POSTGRES_DB
:
airflow
volumes
:
-
postgres-db-volume:/var/lib/postgresql/data
healthcheck
:
test
:
[
"
CMD"
,
"
pg_isready"
,
"
-U"
,
"
airflow"
]
interval
:
5s
retries
:
5
restart
:
always
redis
:
image
:
redis:latest
ports
:
-
6379:6379
healthcheck
:
test
:
[
"
CMD"
,
"
redis-cli"
,
"
ping"
]
interval
:
5s
timeout
:
30s
retries
:
50
restart
:
always
airflow-webserver
:
<<
:
*airflow-common
command
:
webserver
ports
:
-
7001:8080
healthcheck
:
test
:
[
"
CMD"
,
"
curl"
,
"
--fail"
,
"
http://localhost:7001/health"
]
interval
:
10s
timeout
:
10s
retries
:
5
restart
:
always
airflow-scheduler
:
<<
:
*airflow-common
command
:
scheduler
healthcheck
:
test
:
[
"
CMD-SHELL"
,
'
airflow
jobs
check
--job-type
SchedulerJob
--hostname
"$${HOSTNAME}"'
]
interval
:
10s
timeout
:
10s
retries
:
5
restart
:
always
airflow-worker
:
<<
:
*airflow-common
command
:
celery worker
healthcheck
:
test
:
-
"
CMD-SHELL"
-
'
celery
--app
airflow.executors.celery_executor.app
inspect
ping
-d
"celery@$${HOSTNAME}"'
interval
:
10s
timeout
:
10s
retries
:
5
restart
:
always
airflow-init
:
<<
:
*airflow-common
command
:
version
environment
:
<<
:
*airflow-common-env
_AIRFLOW_DB_UPGRADE
:
'
true'
_AIRFLOW_WWW_USER_CREATE
:
'
true'
_AIRFLOW_WWW_USER_USERNAME
:
${_AIRFLOW_WWW_USER_USERNAME:-airflow}
_AIRFLOW_WWW_USER_PASSWORD
:
${_AIRFLOW_WWW_USER_PASSWORD:-airflow}
flower
:
<<
:
*airflow-common
command
:
celery flower
ports
:
-
5555:5555
healthcheck
:
test
:
[
"
CMD"
,
"
curl"
,
"
--fail"
,
"
http://localhost:5555/"
]
interval
:
10s
timeout
:
10s
retries
:
5
restart
:
always
volumes
:
postgres-db-volume
:
This diff is collapsed.
Click to expand it.
dockers/install.md
0 → 100644
+
26
−
0
View file @
7c64efba
== Setup instance
Based on Christians cloud-init file:
#cloud-config
# upgrade packages
package_upgrade: true
# install relevant packages
packages:
-
python3
-
python3-pip
-
docker.io
-
docker-compose
runcmd:
-
usermod -aG docker ubuntu
Think about the security group for the isntance (e.g. to enable access to webgut 7001 port should be open). There is airflows group in HDF.
== Prepare env
mkdir ./dags ./logs ./plugins
echo -e "AIRFLOW_UID=$(id -u)
\n
AIRFLOW_GID=0" > .env
docker-compose up airflow-init
== Start-up
docker-compose up -d
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment