forked from emergentmethods/flowdapt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
87 lines (74 loc) · 2.44 KB
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
version: '3'
vars:
PACKAGE_SRC_DIR: flowdapt
# Docker specific variables
DOCKER_BUILDKIT: 1
IMAGE_REGISTRY: ghcr.io
IMAGE_REPOSITORY: emergentmethods/flowdapt
IMAGE_NAME: "{{.IMAGE_REGISTRY}}/{{.IMAGE_REPOSITORY}}"
IMAGE_TAG: local
DOCKER_BUILD_ARGS: ""
PYTHON_VERSION: 3.11
tasks:
# ---------------------
# Linting
lint:
cmds:
- flake8 {{.PACKAGE_SRC_DIR}}
# Run unit tests
unit-tests:
cmds:
- coverage run -m pytest --junitxml=report.xml
- coverage report
- coverage xml
- coverage html -d coverage-report
# Build the documentation
build-docs:
cmds:
- cp openapi.json docs/reference/api/openapi.json
- mkdocs build
run-docs:
cmds:
- mkdocs serve
# ---------------------
# Build the docs image
build-docker-docs:
requires:
vars: [
IMAGE_NAME,
IMAGE_TAG,
PYTHON_VERSION,
]
cmds:
- docker build -f docker/docs.Dockerfile {{.DOCKER_BUILD_ARGS}} --build-arg PYTHON_VERSION={{.PYTHON_VERSION}} -t {{.IMAGE_NAME}}:docs-{{.IMAGE_TAG}} -t {{.IMAGE_NAME}}:docs-latest .
# Build the base image
build-docker-base:
requires:
vars: [
IMAGE_NAME,
IMAGE_TAG,
PYTHON_VERSION,
]
cmds:
- docker build -f docker/base.Dockerfile {{.DOCKER_BUILD_ARGS}} --build-arg PYTHON_VERSION={{.PYTHON_VERSION}} -t {{.IMAGE_NAME}}:{{.IMAGE_TAG}} .
# Build the full image, including flowml, the openmeteo plugin and build dependencies
build-docker-full:
requires:
vars: [
IMAGE_NAME,
IMAGE_TAG,
PYTHON_VERSION,
]
cmds:
- docker build -f docker/complete.Dockerfile {{.DOCKER_BUILD_ARGS}} --build-arg PYTHON_VERSION={{.PYTHON_VERSION}} --build-arg BASE_IMAGE={{.IMAGE_NAME}}:{{.IMAGE_TAG}} -t {{.IMAGE_NAME}}:{{.IMAGE_TAG}}-full .
# Build the gpu image with CUDA support on top of the full image
build-docker-gpu:
requires:
vars: [
IMAGE_NAME,
IMAGE_TAG,
PYTHON_VERSION,
]
cmds:
- docker build -f docker/gpu.Dockerfile {{.DOCKER_BUILD_ARGS}} --build-arg PYTHON_VERSION={{.PYTHON_VERSION}} --build-arg BASE_IMAGE={{.IMAGE_NAME}}:{{.IMAGE_TAG}} -t {{.IMAGE_NAME}}:{{.IMAGE_TAG}}-gpu .
- docker build -f docker/gpu.Dockerfile {{.DOCKER_BUILD_ARGS}} --build-arg PYTHON_VERSION={{.PYTHON_VERSION}} --build-arg BASE_IMAGE={{.IMAGE_NAME}}:{{.IMAGE_TAG}}-full -t {{.IMAGE_NAME}}:{{.IMAGE_TAG}}-full-gpu .