Skip to content

Commit 0a8fab2

Browse files
Merge branch 'master' into cluster-label-docs
2 parents 5734418 + a3c88e3 commit 0a8fab2

File tree

95 files changed

+2907
-762
lines changed

Some content is hidden

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

95 files changed

+2907
-762
lines changed

.github/workflows/deploy-docs.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
has-secrets:
1414
name: Check Secrets
1515
runs-on: ubuntu-latest
16+
1617
steps:
1718
- id: docs
1819
env:
@@ -25,26 +26,28 @@ jobs:
2526
setup-build-publish-deploy:
2627
name: Deploy docs
2728
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
31+
packages: write
32+
id-token: write
2833
needs: [has-secrets]
2934
env:
3035
PROJECT_ID: ${{ secrets.GKE_PROD_PROJECT }}
31-
3236
steps:
3337
- name: Checkout
34-
uses: actions/checkout@v2
38+
uses: actions/checkout@v4
3539

36-
- uses: google-github-actions/setup-gcloud@v0.2.0
40+
- uses: google-github-actions/auth@v2
3741
if: needs.has-secrets.outputs.docs
3842
with:
39-
service_account_key: ${{ secrets.GKE_PROD_SA_KEY }}
4043
project_id: ${{ secrets.GKE_PROD_PROJECT }}
41-
export_default_credentials: true
44+
workload_identity_provider: 'projects/429189597230/locations/global/workloadIdentityPools/github/providers/robusta-repos' # prod
4245

43-
# Configure Docker to use the gcloud command-line tool as a credential helper for authentication
44-
- name: Configure Docker
46+
- name: Set up gcloud CLI
47+
uses: google-github-actions/setup-gcloud@v2
4548
if: needs.has-secrets.outputs.docs
46-
run: |-
47-
gcloud auth configure-docker us-central1-docker.pkg.dev
49+
with:
50+
project_id: ${{ secrets.GKE_PROD_PROJECT }}
4851

4952
- name: Set up Python
5053
uses: actions/setup-python@v2

.github/workflows/release.yaml

Lines changed: 111 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -6,115 +6,120 @@ on:
66

77
env:
88
PROJECT_ID: ${{ secrets.GKE_PROD_PROJECT }}
9-
# ` `` GKE_ZONE: us-central1-c # TODO: update to cluster zone
10-
RELEASE_VER : ${{ github.event.release.tag_name }}
11-
jobs:
9+
# ` `` GKE_ZONE: us-central1-c # TODO: update to cluster zone
10+
RELEASE_VER: ${{ github.event.release.tag_name }}
1211

12+
jobs:
1313
setup-build-publish-deploy:
1414
name: Build images
1515
runs-on: ubuntu-latest
1616

17+
permissions:
18+
contents: read
19+
packages: write
20+
id-token: write
21+
1722
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v2
20-
21-
- name: Get release version
22-
run: echo "$RELEASE_VER"
23-
24-
- uses: google-github-actions/setup-gcloud@v0.2.0
25-
with:
26-
service_account_key: ${{ secrets.GKE_PROD_SA_KEY }}
27-
project_id: ${{ secrets.GKE_PROD_PROJECT }}
28-
export_default_credentials: true
29-
30-
# Configure Docker to use the gcloud command-line tool as a credential helper for authentication
31-
- run: |-
32-
gcloud auth configure-docker us-central1-docker.pkg.dev
33-
34-
- run: |-
35-
gcloud config get-value project
36-
37-
- run: |-
38-
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
39-
chmod a+x skaffold
40-
41-
- name: Update package version
42-
run: |
43-
sed -i 's/0.0.0/${{env.RELEASE_VER}}/g' src/robusta/_version.py helm/robusta/Chart.yaml helm/robusta/values.yaml
44-
sed -i 's/version = "0.0.0"/version = "${{env.RELEASE_VER}}"/g' pyproject.toml
45-
sed -i 's/0.0.1/${{env.RELEASE_VER}}/g' helm/robusta/Chart.yaml
46-
47-
# Set up the buildx to run build for multiple platforms
48-
- name: Set up QEMU
49-
uses: docker/setup-qemu-action@c5ffa2a61740d9877bd1f40899a87c8ec93b0d9f
50-
51-
- name: Docker Setup Buildx
52-
uses: docker/setup-buildx-action@bea6a01aa40b4d58b0382d47e1c4a70137af67b1
53-
with:
54-
config-inline: |
55-
[worker.oci]
56-
enabled = true
57-
platforms = [ "linux/amd64", "linux/arm64" ]
58-
59-
# see https://github.com/GoogleContainerTools/skaffold/issues/4842
60-
- name: Cache skaffold image builds & config
61-
uses: actions/cache@v2
62-
with:
63-
path: ~/.skaffold/
64-
key: fixed-${{ github.sha }}
65-
restore-keys: |
66-
fixed-${{ github.sha }}
67-
fixed-
68-
69-
- name: Login to Docker Hub
70-
uses: docker/login-action@v1
71-
with:
72-
username: ${{ secrets.DOCKER_USERNAME }}
73-
password: ${{ secrets.DOCKER_PASSWORD }}
74-
75-
- name: Build with skaffold
76-
run: ./skaffold build --profile release --file-output=container-ids.json --tag='${{env.RELEASE_VER}}'
77-
78-
79-
- name: Save artifact with tags of built containers
80-
uses: actions/upload-artifact@v4
81-
with:
82-
name: container-ids
83-
path: container-ids.json
84-
85-
- name: Set up Python
86-
uses: actions/setup-python@v2
87-
with:
88-
python-version: 3.9
89-
90-
- name: Install dependencies
91-
run: |
92-
python -m pip install --upgrade pip
93-
pip install twine
94-
95-
- name: Prepare pypi dist
96-
run: |
97-
curl -sSL https://install.python-poetry.org | python3 - --version 1.4.0
98-
poetry config virtualenvs.create false
99-
poetry install --extras "all"
100-
poetry publish --build -u __token__ -p ${{ secrets.PYPI_PROJECT_TOKEN }}
101-
102-
- name: Save artifact with helm chart
103-
uses: actions/upload-artifact@v4
104-
with:
105-
name: helm-chart
106-
path: helm/robusta/
107-
108-
- name: Release Docker to Dockerhub
109-
run: |-
110-
docker buildx build \
111-
--build-arg BUILDKIT_INLINE_CACHE=1 \
112-
--platform linux/arm64,linux/amd64 \
113-
--cache-from us-central1-docker.pkg.dev/genuine-flight-317411/devel/robusta:cache \
114-
--tag robustadev/robusta-runner:${{env.RELEASE_VER}} \
115-
--push \
116-
.
117-
118-
- name: Upload helm chart
119-
run: |
120-
cd helm && ./upload_chart.sh
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Get release version
27+
run: echo "$RELEASE_VER"
28+
29+
- uses: google-github-actions/auth@v2
30+
with:
31+
project_id: ${{ secrets.GKE_PROD_PROJECT }}
32+
workload_identity_provider: 'projects/429189597230/locations/global/workloadIdentityPools/github/providers/robusta-repos' # prod
33+
34+
- name: Set up gcloud CLI
35+
uses: google-github-actions/setup-gcloud@v2
36+
with:
37+
project_id: ${{ secrets.GKE_PROD_PROJECT }}
38+
39+
- name: Configure Docker Registry
40+
run: gcloud auth configure-docker us-central1-docker.pkg.dev
41+
42+
43+
- run: |-
44+
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
45+
chmod a+x skaffold
46+
47+
- name: Update package version
48+
run: |
49+
sed -i 's/0.0.0/${{env.RELEASE_VER}}/g' src/robusta/_version.py helm/robusta/Chart.yaml helm/robusta/values.yaml
50+
sed -i 's/version = "0.0.0"/version = "${{env.RELEASE_VER}}"/g' pyproject.toml
51+
sed -i 's/0.0.1/${{env.RELEASE_VER}}/g' helm/robusta/Chart.yaml
52+
53+
# Set up the buildx to run build for multiple platforms
54+
- name: Set up QEMU
55+
uses: docker/setup-qemu-action@c5ffa2a61740d9877bd1f40899a87c8ec93b0d9f
56+
57+
- name: Docker Setup Buildx
58+
uses: docker/setup-buildx-action@bea6a01aa40b4d58b0382d47e1c4a70137af67b1
59+
with:
60+
config-inline: |
61+
[worker.oci]
62+
enabled = true
63+
platforms = [ "linux/amd64", "linux/arm64" ]
64+
65+
# see https://github.com/GoogleContainerTools/skaffold/issues/4842
66+
- name: Cache skaffold image builds & config
67+
uses: actions/cache@v4
68+
with:
69+
path: ~/.skaffold/
70+
key: fixed-${{ github.sha }}
71+
restore-keys: |
72+
fixed-${{ github.sha }}
73+
fixed-
74+
75+
- name: Login to Docker Hub
76+
uses: docker/login-action@v1
77+
with:
78+
username: ${{ secrets.DOCKER_USERNAME }}
79+
password: ${{ secrets.DOCKER_PASSWORD }}
80+
81+
- name: Build with skaffold
82+
run: ./skaffold build --profile release --file-output=container-ids.json --tag='${{env.RELEASE_VER}}'
83+
84+
- name: Save artifact with tags of built containers
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: container-ids
88+
path: container-ids.json
89+
90+
- name: Set up Python
91+
uses: actions/setup-python@v2
92+
with:
93+
python-version: 3.9
94+
95+
- name: Install dependencies
96+
run: |
97+
python -m pip install --upgrade pip
98+
pip install twine
99+
100+
- name: Prepare pypi dist
101+
run: |
102+
curl -sSL https://install.python-poetry.org | python3 - --version 1.4.0
103+
poetry config virtualenvs.create false
104+
poetry install --extras "all"
105+
poetry publish --build -u __token__ -p ${{ secrets.PYPI_PROJECT_TOKEN }}
106+
107+
- name: Save artifact with helm chart
108+
uses: actions/upload-artifact@v4
109+
with:
110+
name: helm-chart
111+
path: helm/robusta/
112+
113+
- name: Release Docker to Dockerhub
114+
run: |-
115+
docker buildx build \
116+
--build-arg BUILDKIT_INLINE_CACHE=1 \
117+
--platform linux/arm64,linux/amd64 \
118+
--cache-from us-central1-docker.pkg.dev/genuine-flight-317411/devel/robusta:cache \
119+
--tag robustadev/robusta-runner:${{env.RELEASE_VER}} \
120+
--push \
121+
.
122+
123+
- name: Upload helm chart
124+
run: |
125+
cd helm && ./upload_chart.sh

0 commit comments

Comments
 (0)