Easily deploy Airflow for local development
Project description
Dockflow CLI
This package requires docker to be installed and running on your machine.
Getting started
-
Install dockflow:
pip install dockflow -
Authenticate docker to pull from private GCR repository:
2.1. First make sure that yourgcloudis authenticated usinggcloud auth application-default login --impersonate-service-account=<service-account>.
2.2. Ensure you are in the correct project usinggcloud config set project <project name>
2.3. Usegcloud auth configure-docker <location>-docker.pkg.devto configure gcloud as the credential helper for the Artifact Registry domain associated with your repository’s location. For example,gcloud auth configure-docker europe-west1-docker.pkg.dev.
Quickstart
- Ensure that your docker file sharing settings allows access to your development directory.
- Navigate to the root directory of your
dagsfolder. - Use
dockflow configand enter your container repo url excluding the version.- This will save the url in a config file.
- Eg.
<location>-docker.<domain>/<project-id>/<repo-id>/<image> - If you get permission errors, Ensure that you have artifact reader permission on this registry.
- This should only be used if the container repo changes.
- If the image version tag is not
composer-2.9.8-airflow-2.9.3specify the tag usingdockflow start -iv <version>. Alternatively, use the--check-imagesflag to list the available images at the provided container repo. - Use
dockflow start(This will mount the dag folder and start Airflow). - Use the UI to add connections.
- Admin -> Connections -> Create
- If you need to connect to a GCP resource, provide values for the following fields:
- Project Id, e.g.
research-se-de - Credential configuration file, located at
/usr/local/airflow/gcp_credentials.json - Impersonation chain, e.g.
local-file-ingestor@research-se-de.iam.gserviceaccount.com
- Project Id, e.g.
- Use
dockflow refreshto refresh the configs cache or to bundle configs. - Remember to use
dockflow stopto shut down the instance to save local machine resources.- The state will be persisted in the same directory as the
dagsfolder.
- The state will be persisted in the same directory as the
- To stop and remove the container use
dockflow stop --rm
CloudSQL Proxy
docker run -d \
-v <PATH_TO_KEY_FILE>:/config \
-p 127.0.0.1:5432:5432 \
--network='dockflow' \
--name='cloudsql' \
gcr.io/cloudsql-docker/gce-proxy:1.17 /cloud_sql_proxy \
-instances=<INSTANCE_CONNECTION_NAME>=tcp:0.0.0.0:5432 -credential_file=/config
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dockflow-1.2.0.tar.gz.
File metadata
- Download URL: dockflow-1.2.0.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2aff7e51ae210846d0e0a73ebac832ec55fa5d820e9d758e965edb2f7242aade
|
|
| MD5 |
2c0a1b50fd5f206cd55fa350c04b9ce2
|
|
| BLAKE2b-256 |
1f374b0d58327be295b438440e02b28dfee821a5ac939ca6deee972a9f52aa70
|
File details
Details for the file dockflow-1.2.0-py3-none-any.whl.
File metadata
- Download URL: dockflow-1.2.0-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de5136fcf500b1c56406c78c1b4aa94a05e305e98a35ebac724892328d925bf4
|
|
| MD5 |
3a4f77493f515b24372d3a2464e89e7d
|
|
| BLAKE2b-256 |
56141b559b821a0f0d989073b091eb952467671f22e3795f3f4cf9ec88449bc1
|