Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor operator to work with hoprd providence #149

Merged
merged 48 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
adcad06
Main refactoring
ausias-armesto Oct 31, 2023
4d44a1f
Fix scripts
ausias-armesto Nov 1, 2023
4990cba
Update script
ausias-armesto Nov 1, 2023
7c7f0d7
Add contracts dir
ausias-armesto Nov 1, 2023
b9cade8
remove spaces
ausias-armesto Nov 1, 2023
3cde3c9
add time
ausias-armesto Nov 1, 2023
52c222a
Update script
ausias-armesto Nov 2, 2023
65ccc97
Fixing path
ausias-armesto Nov 2, 2023
5729e8e
Remove unused import
ausias-armesto Nov 2, 2023
6136c1d
Update dummy script
ausias-armesto Nov 2, 2023
e2b4641
Download script
ausias-armesto Nov 2, 2023
0b085b3
Filtering active jobs
ausias-armesto Nov 2, 2023
35d0833
remove declare
ausias-armesto Nov 2, 2023
c09662d
More bug fixing
ausias-armesto Nov 2, 2023
c6e00e5
Fix double sync
ausias-armesto Nov 3, 2023
0c44780
Adding format
ausias-armesto Nov 3, 2023
fdac648
Adding modification
ausias-armesto Nov 3, 2023
63c3aeb
Use correct deployer
ausias-armesto Nov 3, 2023
8a2ce15
Update more code
ausias-armesto Nov 6, 2023
2c22f29
Update to 0.2.0
ausias-armesto Nov 6, 2023
3efe49d
Adding more error handling
ausias-armesto Nov 6, 2023
eafc54e
adding debugging
ausias-armesto Nov 6, 2023
d20219f
Adding identity on resource creation
ausias-armesto Nov 6, 2023
b76299e
Update runner to self hosted
ausias-armesto Nov 6, 2023
9eaaa4d
Update versions
ausias-armesto Nov 6, 2023
25f0469
Fixing creating node with different pattern
ausias-armesto Nov 6, 2023
57c2f4e
Basic manual testing works
ausias-armesto Nov 8, 2023
50038cf
Include modification of resources
ausias-armesto Nov 10, 2023
9af80ed
Add more fixes
ausias-armesto Nov 13, 2023
58c61ec
Remove files
ausias-armesto Nov 13, 2023
540acea
moving events
ausias-armesto Nov 13, 2023
659b78d
Updating to alpha2
ausias-armesto Nov 13, 2023
23cf631
cargo update
ausias-armesto Nov 13, 2023
5521897
Merge branch 'master' into ausias/refactor-operator
ausias-armesto Nov 13, 2023
810b82d
Fixing clusterHoprd
ausias-armesto Nov 13, 2023
bed5f1d
fixing context
ausias-armesto Nov 13, 2023
22ef37a
Fixing helm-chart
ausias-armesto Nov 13, 2023
ef30e45
remove dash
ausias-armesto Nov 13, 2023
3f145e1
Increasing resources
ausias-armesto Nov 13, 2023
14430a0
Fix service monitor
ausias-armesto Nov 14, 2023
eacd22a
Fixing pipelines
ausias-armesto Nov 14, 2023
0972768
Update parameters README.md
hopr-version-bot Nov 14, 2023
8428441
Fixing pipelines
ausias-armesto Nov 14, 2023
396a75d
Merge branch 'ausias/refactor-operator' of https://github.com/hoprnet…
ausias-armesto Nov 14, 2023
0d8b0d9
Update parameters README.md
hopr-version-bot Nov 14, 2023
633f6dd
Using github runners
ausias-armesto Nov 14, 2023
cbc980a
adding docker to publish
ausias-armesto Nov 14, 2023
b2ab2af
Merge branch 'ausias/refactor-operator' of https://github.com/hoprnet…
ausias-armesto Nov 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
---

name: 'Build Container'

name: 'Build Docker Image'
on:
pull_request:
types:
- synchronize
- ready_for_review
branches:
- master
paths-ignore:
- "charts/**/*"
concurrency:
group: ${{ github.head_ref }}-container
group: ${{ github.head_ref }}-docker
cancel-in-progress: true
jobs:
bump_version:
runs-on: ubuntu-latest
name: Bump version
runs-on: ubuntu-2-core
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Bump Cargo version
id: bumping_version
Expand Down Expand Up @@ -53,7 +54,7 @@ jobs:
if: ${{ steps.bumping_version.outputs.bumped_version }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Bump cargo version
commit_message: "Bump to cargo version ${{ steps.bumping_version.outputs.bumped_version }}"
repository: .
commit_user_name: HOPR CI robot
commit_user_email: [email protected]
Expand All @@ -63,11 +64,17 @@ jobs:
create_branch: false

build:
name: Build docker
needs: bump_version
runs-on: ubuntu-latest
runs-on: ubuntu-2-core
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build container image
uses: docker/build-push-action@v5
with:
push: false
tags: gcr.io/hoprassociation/hoprd-operator:latest
tags: europe-west3-docker.pkg.dev/hoprassociation/docker-images/hoprd-operator:latest


Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,26 @@ name: 'Package Helm chart Cluster'

on:
pull_request:
types:
- synchronize
- ready_for_review
branches:
- master
paths:
- "charts/cluster-hoprd/**"
concurrency:
group: ${{ github.head_ref }}-cluster
cancel-in-progress: true
jobs:
bump_version:
runs-on: ubuntu-latest
name: Bump version
runs-on: ubuntu-2-core
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Bump Chart version
id: bumping_version
run: |
helm_chart_version=$(grep '^version:' Chart.yaml | sed 's/.*: //')
git_tag=$(git tag -l helm-cluster-hoprd-${helm_chart_version})
Expand All @@ -29,14 +34,15 @@ jobs:
bump_version=${release_number}.$((patch_number + 1))
echo "The helm chart version ${git_tag} already exists, bumping to version helm-cluster-hoprd-${bump_version}";
sed -i "s/^version: ${helm_chart_version}/version: ${bump_version}/" Chart.yaml
echo "version_bumped=true" >> $GITHUB_ENV
echo "bumped_version=true" >> $GITHUB_OUTPUT
fi
working-directory: 'charts/cluster-hoprd/'

- name: Commit and push
if: ${{ env.version_bumped }}
if: ${{ steps.bumping_version.outputs.bumped_version }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Bump Helm chart version
commit_message: "Bump Helm chart version to ${{ steps.bumping_version.outputs.bumped_version }}"
repository: .
commit_user_name: HOPR CI robot
commit_user_email: [email protected]
Expand All @@ -46,76 +52,101 @@ jobs:
create_branch: false

lint:
runs-on: ubuntu-latest
name: Lint
runs-on: ubuntu-2-core
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Lint
run: |
helm dependency update
helm lint
run: helm lint
working-directory: 'charts/cluster-hoprd/'

package:
runs-on: ubuntu-latest
name: Package Helm Chart
runs-on: ubuntu-2-core
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get Helm chart version
id: get_version
run: |
HELM_CHART_VERSION=$(grep '^version:' Chart.yaml | sed 's/.*: //')
echo "HELM_CHART_VERSION=${HELM_CHART_VERSION}" >> $GITHUB_ENV
echo "HELM_CHART_VERSION=${HELM_CHART_VERSION}" >> $GITHUB_OUTPUT
working-directory: 'charts/cluster-hoprd/'

- name: Set up Google Cloud Credentials
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GOOGLE_HOPRASSOCIATION_CREDENTIALS_REGISTRY }}
# - name: Set up Google Cloud Credentials
# uses: google-github-actions/auth@v1
# with:
# credentials_json: ${{ secrets.GOOGLE_HOPRASSOCIATION_CREDENTIALS_REGISTRY }}

- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GOOGLE_HOPRASSOCIATION_PROJECT }}
install_components: beta
# - name: Set up Google Cloud SDK
# uses: google-github-actions/setup-gcloud@v1
# with:
# project_id: ${{ secrets.GOOGLE_HOPRASSOCIATION_PROJECT }}
# install_components: beta

- name: Artifact Registry authentication
run: gcloud auth application-default print-access-token | helm registry login -u oauth2accesstoken --password-stdin https://europe-west3-docker.pkg.dev
# - name: Artifact Registry authentication
# run: make gcp-login

- name: Helm Package
run: |
helm package . --version ${{ env.HELM_CHART_VERSION }}
run: helm package . --version ${{ steps.get_version.outputs.HELM_CHART_VERSION }}
working-directory: 'charts/cluster-hoprd/'

trivy:
name: Helm Security Analysis
runs-on: ubuntu-2-core
permissions:
security-events: write
actions: read
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4 # 93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0

- name: Set up Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # tag=v3.5
with:
version: v3.6.3

- name: Set up python
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # tag=v4.7.1
with:
python-version: 3.7

- name: Run Trivy vulnerability scanner in IaC mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'config'
hide-progress: false
format: 'table'
scan-ref: 'charts/hoprd-operator/'
exit-code: '1'
ignore-unfixed: true

generate-readme:
runs-on: ubuntu-latest
name: Generate Readme
runs-on: ubuntu-2-core
permissions:
contents: write
steps:
- name: Install readme-generator-for-helm
run: npm install -g @bitnami/[email protected]

- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0

- name: Install readme-generator-for-helm
run: npm install -g @bitnami/[email protected]

- name: Execute readme-generator-for-helm
id: generator
run: |
readme-generator --values "charts/cluster-hoprd/values.yaml" --readme "charts/cluster-hoprd/README.md" --schema "/tmp/schema.json"
if git status -s | grep charts; then
echo "readme_updated=true" >> $GITHUB_ENV
echo "readme_updated=true" >> $GITHUB_OUTPUT
fi

- name: Commit and push
if: ${{ env.readme_updated }}
if: ${{ steps.generator.outputs.readme_updated }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update parameters README.md
Expand Down
Loading