Skip to content

Commit 0f0f2aa

Browse files
committed
Template componnets charts
1 parent 0d05d25 commit 0f0f2aa

File tree

35 files changed

+92
-89
lines changed

35 files changed

+92
-89
lines changed

.github/workflows/component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
9393
- name: Push image
9494
if: steps.build-image.outputs.SKIP_IMAGE != 'true'
95-
run: make -C "${COMPONENT_DIR}" push-image
95+
run: make -C "${COMPONENT_DIR}" publish-image
9696

9797
- name: Lint chart
9898
if: steps.build-image.outputs.SKIP_IMAGE != 'true'

.gitignore

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
*.build
2+
*.egg-info/
3+
*.python-version
4+
*.venv*
5+
.DS_Store
6+
.coverage
17
.idea
28
.idea/*
3-
.coverage
4-
*.venv*
5-
common_libs/
6-
reports/
79
__pycache__/
8-
*.egg-info/
910
build/
10-
.DS_Store
11-
*.python-version
11+
common_libs/
12+
reports/

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ make tests
148148
- `build`: Create binaries
149149
- `publish`: Publish artifacts to registries
150150
- `build-image`: Build a container image
151-
- `push-image`: Publish a container image
151+
- `publish-image`: Publish a container image
152152
- `lint-chart`: Lint a helm chart
153153
- `publish-chart`: Publish a helm chart
154154

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ clean:
2323
push:
2424
echo "Pushing all projects..."
2525
@for dir in $(PROJECTS); do \
26-
echo "Running make push-image in $$dir..."; \
27-
$(MAKE) -C $$dir push-image; \
26+
echo "Running make publish-image in $$dir..."; \
27+
$(MAKE) -C $$dir publish-image; \
2828
done
2929

3030
static-code-analysis:

Makefile.build

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ build-image-go:
2323
build-image-python:
2424
@$(call run_for_each,$(PY_BUILDABLE_SUBPROJECTS),Building image for Python component,build-image)
2525

26-
.PHONY: push-image
27-
push-image: push-image-go push-image-python
26+
.PHONY: publish-image
27+
publish-image: publish-image-go publish-image-python
2828

29-
.PHONY: push-image-go
30-
push-image-go:
31-
@$(call run_for_each,$(GO_BUILDABLE_SUBPROJECTS),Pushing image for Go component,push-image)
29+
.PHONY: publish-image-go
30+
publish-image-go:
31+
@$(call run_for_each,$(GO_BUILDABLE_SUBPROJECTS),Pushing image for Go component,publish-image)
3232

33-
.PHONY: push-image-python
34-
push-image-python:
35-
@$(call run_for_each,$(PY_BUILDABLE_SUBPROJECTS),Pushing image for Python component,push-image)
33+
.PHONY: publish-image-python
34+
publish-image-python:
35+
@$(call run_for_each,$(PY_BUILDABLE_SUBPROJECTS),Pushing image for Python component,publish-image)
3636

3737
.PHONY: tests
3838
tests: tests-go tests-python

Makefile.shared

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
CWD = $(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))))
55

6-
.PHONY: build-image-default push-image publish-chart lint-chart-default
6+
.PHONY: build-image-default publish-image publish-chart-default lint-chart-default
77

88
###
99
# version
@@ -27,10 +27,11 @@ BASE_OTE_V2_IMAGE_TAG ?= 12.8.1.1.30
2727
###
2828
# component
2929
###
30-
CHART_DIR := ./chart
30+
CHART_DIR_TEMPLATE := ./chart
31+
CHART_YAML_TEMPLATE := ${CHART_DIR_TEMPLATE}/Chart.yaml.template
32+
CHART_DIR := ${CHART_DIR_TEMPLATE}/.build
3133
CHART_YAML := ${CHART_DIR}/Chart.yaml
32-
COMPONENT_NAME := $(shell grep '^name:' ${CHART_YAML} | sed 's/^name: //')
33-
34+
COMPONENT_NAME := $(shell grep '^name:' ${CHART_YAML_TEMPLATE} | sed 's/^name: //')
3435
###
3536
# docker extra arguments
3637
###
@@ -68,22 +69,31 @@ build-image-default:
6869
-f ./Dockerfile .
6970

7071

71-
push-image:
72+
publish-image:
7273
@echo "Pushing docker image for component: ${COMPONENT_NAME}"
7374
@docker push ${IMAGES_REGISTRY}/${COMPONENT_NAME}:${TAG}
7475

7576
###
7677
# helm charts
7778
###
78-
lint-chart-default:
79+
build-chart:
80+
mkdir -p ${CHART_DIR}
81+
cp ${CHART_YAML_TEMPLATE} ${CHART_YAML}
82+
yq e '.version = "${TAG}"' -i ${CHART_YAML}
83+
yq e '.appVersion = "${TAG}"' -i ${CHART_YAML}
84+
85+
lint-chart-default: build-chart
7986
@echo "Running chart linter for component: ${COMPONENT_NAME}"
8087
helm lint --with-subcharts $(dir ${CHART_YAML})
8188

82-
publish-chart:
89+
publish-chart-default: build-chart
8390
@echo "Publishing chart for component: ${COMPONENT_NAME}"
8491
helm package $(dir ${CHART_YAML}) --version ${TAG}
8592
helm push ${COMPONENT_NAME}-${TAG}.tgz oci://${CHARTS_REGISTRY}
8693

94+
clean-chart:
95+
rm -rf ${CHART_DIR}
96+
8797
# To suppress warnings when overriding Makefile targets, declare the abstract targets as <name>-default
8898
%: %-default
8999
@ true
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v1
22
name: migration-job
33
description: Chart that will deploy script to migrate data
4-
version: 0.0.1
5-
appVersion: v0.0.1
4+
version: '{{VERSION}}'
5+
appVersion: '{{VERSION}}'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: auto-train-controller
3-
version: 0.0.2
3+
version: '{{VERSION}}'
44
apiVersion: v1
55
description: Periodic service that schedules auto-train jobs for the ready tasks
6-
appVersion: v0.0.1
6+
appVersion: '{{VERSION}}'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: dataset-ie
3-
version: 0.0.11
3+
version: '{{VERSION}}'
44
apiVersion: v2
55
description: dataset import and export
6-
appVersion: v0.0.1
6+
appVersion: '{{VERSION}}'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: director
3-
version: 0.0.8
3+
version: '{{VERSION}}'
44
apiVersion: v2
55
description: director
6-
appVersion: v0.0.1
6+
appVersion: '{{VERSION}}'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: inference-gateway
3-
version: 0.0.1
3+
version: '{{VERSION}}'
44
apiVersion: v2
55
description: Inference gateway
6-
appVersion: v0.0.1
6+
appVersion: '{{VERSION}}'

interactive_ai/services/jobs/chart/Chart.yaml renamed to interactive_ai/services/jobs/chart/Chart.yaml.template

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ description: platform chart
44
# This is the chart version. This version number should be incremented each time you make changes
55
# to the chart and its templates, including the app version.
66
# Versions are expected to follow Semantic Versioning (https://semver.org/)
7-
version: 0.0.1
8-
7+
version: '{{VERSION}}'
98
# This is the version number of the application being deployed. This version number should be
109
# incremented each time you make changes to the application. Versions are not expected to
1110
# follow Semantic Versioning. They should reflect the version the application is using.
1211
# It is recommended to use it with quotes.
13-
appVersion: v0.0.1
14-
12+
appVersion: '{{VERSION}}'
1513
dependencies:
1614
- name: jobs-ms
1715
version: 0.0.8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: jobs-ms
3-
version: 0.0.8
3+
version: '{{VERSION}}'
44
apiVersion: v2
55
description: jobs microservice
6-
appVersion: v0.0.1
6+
appVersion: '{{VERSION}}'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: jobs-scheduler
3-
version: 0.0.10
3+
version: '{{VERSION}}'
44
apiVersion: v2
55
description: jobs-scheduler
6-
appVersion: v0.0.1
6+
appVersion: '{{VERSION}}'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: jobs-scheduling-policy
3-
version: 0.0.3
3+
version: '{{VERSION}}'
44
apiVersion: v2
55
description: jobs-scheduling-policy
6-
appVersion: v0.0.1
6+
appVersion: '{{VERSION}}'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: media-ms
3-
version: 0.0.8
3+
version: '{{VERSION}}'
44
apiVersion: v2
55
description: media
6-
appVersion: v0.0.1
6+
appVersion: '{{VERSION}}'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: mlflow-geti-store
3-
version: 0.0.1
3+
version: '{{VERSION}}'
44
apiVersion: v2
55
description: MLflow geti store
6-
appVersion: v0.0.1
6+
appVersion: '{{VERSION}}'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
apiVersion: v1
33
name: modelregistration
4-
version: 0.0.3
5-
appVersion: v0.0.1
4+
version: '{{VERSION}}'
5+
appVersion: '{{VERSION}}'
66
description: A Helm chart for Model Registration Service
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: project-ie
3-
version: 0.0.10
3+
version: '{{VERSION}}'
44
apiVersion: v2
55
description: project import and export
6-
appVersion: v0.0.1
6+
appVersion: '{{VERSION}}'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: resource
3-
version: 0.0.12
3+
version: '{{VERSION}}'
44
apiVersion: v2
55
description: resource
6-
appVersion: v0.0.1
6+
appVersion: '{{VERSION}}'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: visual-prompt
3-
version: 0.0.1
3+
version: '{{VERSION}}'
44
apiVersion: v2
55
description: visual prompt service
6-
appVersion: v0.0.1
6+
appVersion: '{{VERSION}}'

interactive_ai/workflows/geti_domain/common/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ include ../../Makefile.shared-workflows
33
build-image:
44
@echo "Nothing to do - ${COMPONENT_NAME} does not have an image to build"
55

6-
push-image:
6+
publish-image:
77
@echo "Nothing to do - ${COMPONENT_NAME} does not have an image to push"
88

99
test-component: venv
@@ -13,4 +13,4 @@ venv: pre-venv
1313
uv lock --check
1414
# Cuda bindings is a sub-dependency of datumaro and is not needed for Geti.
1515
# The install is therefore skipped here for compatibility with systems that don't support cuda
16-
uv sync --frozen ${PIP_INSTALL_PARAMS} --no-install-package cuda-bindings
16+
uv sync --frozen ${PIP_INSTALL_PARAMS} --no-install-package cuda-bindings

interactive_ai/workflows/geti_domain/dataset_ie/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ venv: pre-venv
2424
uv lock --check
2525
# Cuda bindings is a sub-dependency of datumaro and is not needed for Geti.
2626
# The install is therefore skipped here for compatibility with systems that don't support cuda
27-
uv sync --frozen ${PIP_INSTALL_PARAMS} --no-install-package cuda-bindings
27+
uv sync --frozen ${PIP_INSTALL_PARAMS} --no-install-package cuda-bindings

interactive_ai/workflows/geti_domain/optimize/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ venv: pre-venv
2020
uv lock --check
2121
# Cuda bindings is a sub-dependency of datumaro and is not needed for Geti.
2222
# The install is therefore skipped here for compatibility with systems that don't support cuda
23-
uv sync --frozen ${PIP_INSTALL_PARAMS} --no-install-package cuda-bindings
23+
uv sync --frozen ${PIP_INSTALL_PARAMS} --no-install-package cuda-bindings

interactive_ai/workflows/geti_domain/train/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ venv: pre-venv
2020
uv lock --check
2121
# cuda-bindings is a sub-dependency of datumaro and is not needed for Geti.
2222
# The install is therefore skipped here for compatibility with systems that don't support cuda
23-
uv sync --frozen ${PIP_INSTALL_PARAMS} --no-install-package cuda-bindings
23+
uv sync --frozen ${PIP_INSTALL_PARAMS} --no-install-package cuda-bindings
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: account-service
3-
version: 0.0.2
4-
appVersion: v0.0.1
3+
version: '{{VERSION}}'
4+
appVersion: '{{VERSION}}'
55
apiVersion: v2
66
description: account service
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: auth-proxy
3-
version: 0.1.0
4-
appVersion: v0.0.1
3+
version: '{{VERSION}}'
4+
appVersion: '{{VERSION}}'
55
apiVersion: v2
66
description: A Helm chart for Kubernetes
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apiVersion: v2
22
name: credit-system
33
description: A Helm chart for Kubernetes
4-
54
# A chart can be either an 'application' or a 'library' chart.
65
#
76
# Application charts are a collection of templates that can be packaged into versioned archives
@@ -11,14 +10,12 @@ description: A Helm chart for Kubernetes
1110
# a dependency of application charts to inject those utilities and functions into the rendering
1211
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
1312
type: application
14-
1513
# This is the chart version. This version number should be incremented each time you make changes
1614
# to the chart and its templates, including the app version.
1715
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.0
19-
16+
version: '{{VERSION}}'
2017
# This is the version number of the application being deployed. This version number should be
2118
# incremented each time you make changes to the application. Versions are not expected to
2219
# follow Semantic Versioning. They should reflect the version the application is using.
2320
# It is recommended to use it with quotes.
24-
appVersion: v0.0.1
21+
appVersion: '{{VERSION}}'

platform/services/initial_user/chart/Chart.yaml renamed to platform/services/initial_user/chart/Chart.yaml.template

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
apiVersion: v2
33
name: initial-user
44
description: "Creation of initial user in the account service"
5-
65
# A chart can be either an 'application' or a 'library' chart.
76
#
87
# Application charts are a collection of templates that can be packaged into versioned archives
@@ -12,14 +11,12 @@ description: "Creation of initial user in the account service"
1211
# a dependency of application charts to inject those utilities and functions into the rendering
1312
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
1413
type: application
15-
1614
# This is the chart version. This version number should be incremented each time you make changes
1715
# to the chart and its templates, including the app version.
1816
# Versions are expected to follow Semantic Versioning (https://semver.org/)
19-
version: 0.0.1
20-
17+
version: '{{VERSION}}'
2118
# This is the version number of the application being deployed. This version number should be
2219
# incremented each time you make changes to the application. Versions are not expected to
2320
# follow Semantic Versioning. They should reflect the version the application is using.
2421
# It is recommended to use it with quotes.
25-
appVersion: v0.0.1
22+
appVersion: '{{VERSION}}'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
apiVersion: v2
33
name: notifier
4-
version: 0.0.1
5-
appVersion: v0.0.1
4+
version: '{{VERSION}}'
5+
appVersion: '{{VERSION}}'
66
description: A Helm chart for the notifier
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: observability
3-
version: 0.0.1
3+
version: '{{VERSION}}'
44
description: observability chart
55
apiVersion: v2
6-
appVersion: v0.0.1
6+
appVersion: '{{VERSION}}'

0 commit comments

Comments
 (0)