Skip to content

Commit 3bc5e19

Browse files
committed
test from windows
1 parent 7fae06e commit 3bc5e19

File tree

6 files changed

+37
-40
lines changed

6 files changed

+37
-40
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,3 +332,16 @@ If you face any other problems not mentioned above, please reach out to us.
332332
- [Minio](https://min.io/docs/minio/container/index.html)
333333
- [JupyterLab](https://jupyterlab.readthedocs.io/)
334334
- [Minikube](https://minikube.sigs.k8s.io/docs/)
335+
336+
337+
### TODO:
338+
339+
Make ECR work. How to add credentials?
340+
341+
S3 credentials access?
342+
343+
Add sensor based DAGs
344+
345+
Make CI unittest using conda instead
346+
347+
Update CI to use ECR credentials.

{{ cookiecutter.folder_name }}/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Add License Badge
1313

1414
{{ cookiecutter.project_name|capitalize }}
1515

16-
Please have a look at the documentation to get started!
16+
Please have a look at the [documentation](https://bcdev.github.io/gaiaflow/getting_started/) to get started!
1717
Feel free to update this README as your own.
1818

1919
To add a license, please choose which license you want for your project

{{ cookiecutter.folder_name }}/dags/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ DAGs.
1818
- For testing purposes, you can trigger them manually. If you would like to also manually trigger them for your workflow
1919
you can!
2020
- But if you want your DAG to run periodically, setting the start_date and schedule is important.
21-
- NOTE: By default, if you set a `start_date` in the past, Airflow will try to backfill all those runs. To avoid that,
22-
use catchup=False inside the dag definitions.
2321

2422

2523
## Common parameters used while defining a DAG

{{ cookiecutter.folder_name }}/dags/change_me_task_factory_dag.py

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
# create a docker image to run your package with all the dependencies included.
113113
# Please update the image name below:
114114
# TODO: Talk with Tejas to align on image naming.
115-
image="my-local-image/my-package:0.0.1",
115+
image="<your-image-name>",
116116

117117
# TODO: Discuss with Tejas about a process for creating secrets
118118
secrets=["my-minio-creds"],
@@ -149,7 +149,7 @@
149149
},
150150
},
151151

152-
image="my-local-image/my-package:0.0.1",
152+
image="<your-image-name>",
153153
secrets=["my-minio-creds"],
154154
env_vars={
155155
"MLFLOW_TRACKING_URI": f"http://{MINIKUBE_GATEWAY}:5000",
@@ -174,7 +174,7 @@
174174
"key": "return_value",
175175
},
176176
},
177-
image="my-local-image/my-package:0.0.1",
177+
image="<your-image-name>",
178178
secrets=["my-minio-creds"],
179179
env_vars={
180180
"MLFLOW_TRACKING_URI": f"http://{MINIKUBE_GATEWAY}:5000",
@@ -187,35 +187,4 @@
187187
trainer >> predictor
188188

189189

190-
# TODO:
191-
# [DONE] Update ti.xcom code with simple return dict statements.
192-
# [DONE] Update the cookiecutter so that it allows using Airflow standalone (
193-
# without
194-
# MLOps) for projects requiring only Airflow.
195-
# Make ECR work. How to add credentials?
196-
# [DONE]Make sure task factory works out of the box when new projects are
197-
# created.
198-
# [DONE]Add tests for Airflow dags.
199-
# [DONE]Update the documentation stating that we should only return simple
200-
# objects from the
201-
# main function that airflow needs to execute.
202-
# [DONE]Update documentation providing best practices while working with
203-
# Docker (
204-
# cleanup images on registry, local etc.)
205-
# S3 credentials access?
206-
# Add sensor based DAGs
207-
# [DONE] Add version.py in package
208-
# [DONE] Improve change_me_train.py and other files.
209-
# Make CI unittest using conda instead
210-
# Update CI to use ECR credentials.
211-
# Run ruff, isort.
212-
# [done] Update documentation also including, restarting airflow service after
213-
# env update. now possible using --restart
214-
# [done] after starting prod, restart airflow containers.
215-
# [done] on windows, run pytest --ignore=logs and before that run set
216-
# [done] AIRFLOW_CONFIG=%cd%\airflow_test.cfg
217-
# check jupyter notebooks if they work to be sure.
218-
# [DONE] add task_factory tutorial
219-
# [DONE] write up about the architecture
220-
# [DONE] check all files and readmes once more.
221-
# [DONE] update the architecture diagram in main README
190+

{{ cookiecutter.folder_name }}/docker-compose.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ x-airflow-common:
77
dockerfile: ${AIRFLOW_DOCKERFILE}
88
environment:
99
&airflow-common-env
10-
AIRFLOW__CORE__AUTH_MANAGER: airflow.providers.fab.auth_manager.fab_auth_manager.FabAuthManager
10+
AIRFLOW__CORE__AUTH_MANAGER: "airflow.providers.fab.auth_manager.fab_auth_manager.FabAuthManager"
1111
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
1212
AIRFLOW__CORE__EXECUTION_API_SERVER_URL: 'http://airflow-apiserver:8080/execution/'
1313
AIRFLOW__CORE__EXECUTOR: ${CORE_EXECUTOR}
@@ -161,6 +161,22 @@ services:
161161
command:
162162
- "-c"
163163
- |
164+
echo "=== FORCING USER CREATION ==="
165+
echo "Airflow's auth manager check is broken on windows, creating user manually..."
166+
167+
# Create the user directly, bypassing the broken auth manager check
168+
/entrypoint airflow users create \
169+
--username "${_AIRFLOW_WWW_USER_USERNAME:-admin}" \
170+
--firstname "Admin" \
171+
--lastname "User" \
172+
--role "Admin" \
173+
--email "[email protected]" \
174+
--password "${_AIRFLOW_WWW_USER_PASSWORD:-admin}" \
175+
--verbose || echo "User creation failed or user already exists"
176+
177+
echo "=== USER CREATION COMPLETED ==="
178+
python -c "import airflow.providers.fab.auth_manager.fab_auth_manager; print('FAB provider imported successfully')"
179+
python -c "from airflow.configuration import conf; print('Detected auth manager:', conf.get('core', 'auth_manager'))"
164180
if [[ -z "${AIRFLOW_UID}" ]]; then
165181
echo
166182
echo -e "\033[1;33mWARNING!!!: AIRFLOW_UID not set!\e[0m"
@@ -244,6 +260,7 @@ services:
244260
_AIRFLOW_WWW_USER_USERNAME: ${_AIRFLOW_WWW_USER_USERNAME:-admin}
245261
_AIRFLOW_WWW_USER_PASSWORD: ${_AIRFLOW_WWW_USER_PASSWORD:-admin}
246262
_PIP_ADDITIONAL_REQUIREMENTS: ''
263+
AIRFLOW__CORE__AUTH_MANAGER: "airflow.providers.fab.auth_manager.fab_auth_manager.FabAuthManager"
247264
user: "0:0"
248265
restart: no
249266

{{ cookiecutter.folder_name }}/minikube_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from typing import Any
1010

1111
import yaml
12-
from docker_config import DOCKER_IMAGE_NAME
12+
from docker_image_name_generator import DOCKER_IMAGE_NAME
1313

1414

1515
class MinikubeManager:

0 commit comments

Comments
 (0)