Skip to content

Commit f1febe6

Browse files
authored
migrate to argocd (#1122)
1 parent 7fa36e5 commit f1febe6

File tree

241 files changed

+5398
-17498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+5398
-17498
lines changed

.dockerignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,48 @@ jobs:
3737
PR_URL: ${{ github.event.pull_request.html_url }}
3838
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939

40+
discover-charts:
41+
name: Discover Helm charts
42+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
43+
runs-on: ubuntu-latest
44+
outputs:
45+
helm_charts: ${{ steps.discover.outputs.helm_charts }}
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v6
49+
- name: Collect chart paths
50+
id: discover
51+
shell: bash
52+
run: |
53+
set -eo pipefail
54+
charts=$(find charts -maxdepth 1 -mindepth 1 -type d -printf '%f\n' | sort)
55+
echo "$charts"
56+
{
57+
echo "helm_charts<<EOF"
58+
echo "$charts"
59+
echo "EOF"
60+
} >> "$GITHUB_OUTPUT"
61+
4062
release:
4163
name: Create release
42-
needs: test
64+
needs:
65+
- test
66+
- discover-charts
4367
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
4468
uses: neuro-inc/reuse/.github/workflows/release-service.yaml@v25.12.1
4569
with:
46-
image: platform-operator-controller
47-
helm_charts: platform platform-operator
70+
helm_chart_repo_prefix: /platform-compute
71+
helm_charts: ${{ needs.discover-charts.outputs.helm_charts }}
72+
73+
deploy:
74+
name: Deploy
75+
needs: release
76+
uses: neuro-inc/reuse/.github/workflows/deploy-service.yaml@v25.12.1
77+
secrets:
78+
tf_api_token: ${{ secrets.TF_API_TOKEN }}
79+
with:
80+
environment: prod
81+
dev_workspace: ${{ vars.DEV_TFC_WORKSPACE_JSON }}
82+
prod_workspaces: ${{ vars.PROD_TFC_WORKSPACES_JSON }}
83+
variables: |
84+
platform_version=${{ needs.release.outputs.version }}

.github/workflows/test.yaml

Lines changed: 6 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ on:
33

44
jobs:
55

6-
lint:
7-
name: Lint
6+
test:
7+
name: Test
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout commit
@@ -13,162 +13,23 @@ jobs:
1313
uses: actions/setup-python@v6
1414
with:
1515
python-version-file: .python-version
16-
- name: Install pipx
17-
run: python3 -m pip install --user pipx && python3 -m pipx ensurepath
18-
- name: Install Poetry with pipx
19-
run: |
20-
pipx install poetry
21-
- name: Setup Python dependencies cache
22-
uses: actions/cache@v5
16+
- name: Install Helm
17+
uses: azure/setup-helm@v4
2318
with:
24-
path: ~/.cache/pypoetry
25-
key: poetry-${{ hashFiles('**/poetry.lock') }}
26-
restore-keys: |
27-
poetry-
19+
version: v3.19.4
2820
- name: Install dependencies
2921
run: make setup
3022
- name: Lint
3123
run: |
3224
echo "::add-matcher::.github/actionlint-matcher.json"
3325
make lint
34-
35-
unit:
36-
name: Unit tests
37-
runs-on: ubuntu-latest
38-
steps:
39-
- name: Checkout commit
40-
uses: actions/checkout@v6
41-
- name: Install python
42-
uses: actions/setup-python@v6
43-
with:
44-
python-version-file: .python-version
45-
- name: Install pipx
46-
run: python3 -m pip install --user pipx && python3 -m pipx ensurepath
47-
- name: Install Poetry with pipx
48-
run: |
49-
pipx install poetry
50-
- name: Setup Python dependencies cache
51-
uses: actions/cache@v5
52-
with:
53-
path: ~/.cache/pypoetry
54-
key: poetry-${{ hashFiles('**/poetry.lock') }}
55-
restore-keys: |
56-
poetry-
57-
- name: Install dependencies
58-
run: make setup
5926
- name: Run unit tests
6027
run: make test_unit
61-
- name: Upload coverage to Codecov
62-
uses: codecov/codecov-action@v5
63-
with:
64-
token: ${{ secrets.CODECOV_TOKEN }}
65-
files: .coverage.unit.xml
66-
flags: unit
67-
name: codecov-unit
68-
69-
integration:
70-
name: Integration tests
71-
runs-on: ubuntu-latest
72-
env:
73-
MINIKUBE_DRIVER: none
74-
steps:
75-
- name: Checkout commit
76-
uses: actions/checkout@v6
77-
- name: Install python
78-
uses: actions/setup-python@v6
79-
with:
80-
python-version-file: .python-version
81-
- name: Install pipx
82-
run: python3 -m pip install --user pipx && python3 -m pipx ensurepath
83-
- name: Install Poetry with pipx
84-
run: |
85-
pipx install poetry
86-
- name: Setup Python dependencies cache
87-
uses: actions/cache@v5
88-
with:
89-
path: ~/.cache/pypoetry
90-
key: poetry-${{ hashFiles('**/poetry.lock') }}
91-
restore-keys: |
92-
poetry-
93-
- name: Install dependencies
94-
run: make setup
95-
- name: Login to ghcr.io
96-
uses: docker/login-action@v3
97-
with:
98-
registry: ghcr.io
99-
username: ${{ github.actor }}
100-
password: ${{ github.token }}
101-
- name: Start minikube
102-
run: |
103-
curl -LO https://storage.googleapis.com/minikube/releases/v1.25.2/minikube-linux-amd64
104-
sudo apt-get update
105-
sudo apt-get install -y conntrack
106-
sudo install minikube-linux-amd64 /usr/local/bin/minikube
107-
108-
sudo modprobe bridge
109-
sudo modprobe br_netfilter
110-
sudo sysctl -w net.bridge.bridge-nf-call-iptables=1
111-
112-
minikube start --driver="none" --wait=true
113-
114-
sudo chown -R $USER $HOME/.kube /root/.minikube
115-
sudo chmod -R a+r $HOME/.kube /root/.minikube
116-
sudo find /root/.minikube -name id_rsa -exec chmod 600 {} \;
117-
- name: Run integration tests
118-
run: make test_integration
119-
- name: Upload coverage to Codecov
120-
uses: codecov/codecov-action@v5
121-
with:
122-
token: ${{ secrets.CODECOV_TOKEN }}
123-
files: .coverage.integration.xml
124-
flags: integration
125-
name: codecov-integration
126-
127-
image-upload:
128-
name: Upload image artifact
129-
runs-on: ubuntu-latest
130-
steps:
131-
- name: Checkout commit
132-
uses: actions/checkout@v6
133-
- name: Install python
134-
uses: actions/setup-python@v6
135-
with:
136-
python-version-file: .python-version
137-
- name: Install pipx
138-
run: python3 -m pip install --user pipx && python3 -m pipx ensurepath
139-
- name: Install Poetry with pipx
140-
run: |
141-
pipx install poetry
142-
- name: Setup Python dependencies cache
143-
uses: actions/cache@v5
144-
with:
145-
path: ~/.cache/pypoetry
146-
key: poetry-${{ hashFiles('**/poetry.lock') }}
147-
restore-keys: |
148-
poetry-
149-
- name: Install dependencies
150-
run: make setup
151-
- name: Login to ghcr.io
152-
uses: docker/login-action@v3
153-
with:
154-
registry: ghcr.io
155-
username: ${{ github.actor }}
156-
password: ${{ github.token }}
157-
- name: Build Docker image
158-
run: make docker_build
159-
- name: Upload image artifact
160-
uses: neuro-inc/upload-image-action@v24.4.0
161-
with:
162-
image: platform-operator-controller
163-
token: ${{ github.token }}
16428

16529
check:
16630
name: Check
16731
needs:
168-
- lint
169-
- unit
170-
- integration
171-
- image-upload
32+
- test
17233
runs-on: ubuntu-latest
17334
if: always()
17435
steps:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,6 @@ dmypy.json
135135
.cr-release-packages
136136

137137
requirements.txt
138+
139+
# Debug data of helm unittest plugin
140+
.debug/

.pre-commit-config.yaml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,8 @@ repos:
2727
files: |
2828
docs/spelling_wordlist.txt|
2929
.gitignore
30-
- repo: https://github.com/sondrelg/pep585-upgrade
31-
rev: v1.0
32-
hooks:
33-
- id: upgrade-type-hints
34-
args:
35-
- --futures=true
36-
- repo: https://github.com/astral-sh/ruff-pre-commit
37-
rev: v0.11.12
38-
hooks:
39-
- id: ruff-check
40-
args: [--fix, --exit-non-zero-on-fix]
41-
- id: ruff-format
4230
- repo: https://github.com/sirosen/check-jsonschema
4331
rev: 0.33.0
4432
hooks:
4533
- id: check-github-actions
4634
- id: check-github-workflows
47-
- repo: https://github.com/python-poetry/poetry
48-
rev: '2.1.2'
49-
hooks:
50-
- id: poetry-install
51-
ci:
52-
skip:
53-
# - actionlint-docker
54-
- check-github-actions
55-
- check-github-workflows

Dockerfile

Lines changed: 0 additions & 40 deletions
This file was deleted.

Makefile

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,35 @@
11
.PHONY: all test clean
22
all test clean:
33

4-
.PHONY: venv
54
venv:
6-
poetry lock
7-
poetry install --with dev;
5+
python -m venv venv
6+
. venv/bin/activate; \
7+
pip install pre-commit
88

99
.PHONY: setup
1010
setup: venv
11-
poetry run pre-commit install;
11+
. venv/bin/activate; \
12+
python -m pre_commit install
13+
helm plugin install https://github.com/helm-unittest/helm-unittest.git
1214

1315

1416
.PHONY: lint
1517
lint: format
16-
poetry run mypy platform_operator tests
18+
@for chart in charts/*; do \
19+
helm lint $$chart || exit $$?; \
20+
done
1721

22+
.PHONY: format
1823
format:
1924
ifdef CI_LINT_RUN
20-
poetry run pre-commit run --all-files --show-diff-on-failure
25+
. venv/bin/activate; \
26+
python -m pre_commit run --all-files --show-diff-on-failure
2127
else
22-
poetry run pre-commit run --all-files
28+
. venv/bin/activate; \
29+
python -m pre_commit run --all-files
2330
endif
2431

32+
2533
.PHONY: test_unit
2634
test_unit:
27-
poetry run pytest -vv --cov-config=pyproject.toml --cov-report xml:.coverage.unit.xml tests/unit
28-
29-
30-
.PHONY: test_integration
31-
test_integration:
32-
kubectl --context minikube apply -f charts/platform-operator/crds
33-
poetry run pytest -vv --log-level=INFO --cov-config=pyproject.toml --cov-report xml:.coverage.integration.xml tests/integration
34-
35-
.PHONY: clean-dist
36-
clean-dist:
37-
rm -rf dist
38-
39-
IMAGE_NAME = platform-operator-controller
40-
41-
.PHONY: docker_build
42-
docker_build: dist
43-
docker build \
44-
--build-arg PY_VERSION=$$(cat .python-version) \
45-
-t $(IMAGE_NAME):latest .
46-
47-
.python-version:
48-
@echo "Error: .python-version file is missing!" && exit 1
49-
50-
.PHONY: dist
51-
dist: venv
52-
rm -rf build dist; \
53-
poetry export -f requirements.txt --without-hashes -o requirements.txt; \
54-
poetry build -f wheel;
35+
helm unittest charts/*

0 commit comments

Comments
 (0)