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

feat: monorepo setup for lifecycle-operator, scheduler and runtimes #1857

Merged
merged 52 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
ca92f64
add operator to release please config
mowies Aug 1, 2023
12c119f
remove lifecycle operator auto update through release please from hel…
mowies Aug 1, 2023
f6f3721
WIP: use different release artifact matrix
mowies Aug 2, 2023
f6dd040
rebuild release matrix
mowies Aug 3, 2023
728d432
add env variables
mowies Aug 3, 2023
2e9898b
add scheduler to lifecycle-operator release
mowies Aug 4, 2023
aca6838
use different token
mowies Aug 4, 2023
1f7dcdf
add scheduler rp config
mowies Aug 4, 2023
45dff77
remove manifest support
mowies Aug 7, 2023
9da400f
remove whitespace
mowies Aug 7, 2023
e3a6d91
comment out stuff
mowies Aug 7, 2023
87028a2
link lifecycle op and scheduler
mowies Aug 7, 2023
2bcd738
link lifecycle op and scheduler
mowies Aug 7, 2023
b6beeb3
adapt docs for manifest removal
mowies Aug 7, 2023
279a62b
move runtimes into runtimes folder
mowies Aug 7, 2023
c335b52
rename functions-runtime to deno-runtime
mowies Aug 7, 2023
73101ea
add runtimes as separate release artifacts
mowies Aug 7, 2023
b38e01d
chore: add runtimes to eligible release artifacts
mowies Aug 7, 2023
a2a5a16
feat: some change
mowies Aug 7, 2023
d68ec74
chore: remove random change
mowies Aug 7, 2023
8f5f4ed
ci: update release matrix accordingly
mowies Aug 7, 2023
11313e0
fix runtime paths in ci pipeline
mowies Aug 7, 2023
839cbe0
update helm docs
mowies Aug 7, 2023
c0b2ddc
change pr config name
mowies Aug 7, 2023
92573db
add back functions-runtime to the security scans
mowies Aug 7, 2023
b960a1f
remove release please comments from places where renovate will take c…
mowies Aug 7, 2023
66000b1
remove more rp annotations
mowies Aug 7, 2023
ec9059e
fix rp config
mowies Aug 7, 2023
28b12d3
fix semantic pr checker
mowies Aug 7, 2023
fb50522
feat: some feature
mowies Aug 7, 2023
e9a3d55
docs: fix newlines
mowies Aug 8, 2023
bed9497
ci: fix pipelines using functions-runtime
mowies Aug 8, 2023
03e2cf1
feat: fix pipelines using functions-runtime
mowies Aug 8, 2023
f2f0e33
remove debugging changes
mowies Aug 8, 2023
2e7ada1
Update .github/workflows/validate-semantic-pr.yml
mowies Aug 9, 2023
2f804cf
fix functions runtime links in deno readme
mowies Aug 9, 2023
cc277dc
replace more occurrences of functions-runtime
mowies Aug 9, 2023
098eb15
replace occurrences of python-runtime
mowies Aug 9, 2023
076fc90
fix yamllint errors
mowies Aug 9, 2023
735676c
try out rp yaml type version update
mowies Aug 9, 2023
174d34f
use different token
mowies Aug 9, 2023
1437ea4
new try
mowies Aug 9, 2023
a72c0c7
Revert "new try"
mowies Aug 9, 2023
06f668f
Revert "use different token"
mowies Aug 9, 2023
320d946
Revert "try out rp yaml type version update"
mowies Aug 9, 2023
0d4d4ff
remove monitor action from integration tests
mowies Aug 28, 2023
f8db208
Revert "remove monitor action from integration tests"
mowies Aug 28, 2023
6013d3a
Update .github/workflows/integration-test.yml
mowies Aug 28, 2023
10dfaf8
Update .github/workflows/load-test.yml
mowies Aug 28, 2023
4558771
Update .github/workflows/performance-test.yml
mowies Aug 28, 2023
9d956e0
Update docs/content/en/docs/install/install.md
mowies Aug 28, 2023
a5fab48
adjust renovate config
mowies Aug 29, 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
4 changes: 2 additions & 2 deletions .github/actions/deploy-klt-on-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ runs:
run: |
echo "Installing KLT using manifests"
sed -i 's/imagePullPolicy: Always/imagePullPolicy: Never/g' ~/download/artifacts/lifecycle-operator-manifest-test/release.yaml
sed -i 's/ghcr.io\/keptn\/functions-runtime:.*/localhost:5000\/keptn\/functions-runtime:${{ inputs.runtime_tag }}/g' \
sed -i 's/ghcr.io\/keptn\/deno-runtime:.*/localhost:5000\/keptn\/deno-runtime:${{ inputs.runtime_tag }}/g' \
~/download/artifacts/lifecycle-operator-manifest-test/release.yaml
sed -i 's/ghcr.io\/keptn\/python-runtime:.*/localhost:5000\/keptn\/python-runtime:${{ inputs.runtime_tag }}/g' \
~/download/artifacts/lifecycle-operator-manifest-test/release.yaml
Expand Down Expand Up @@ -100,7 +100,7 @@ runs:
--set metricsOperator.manager.imagePullPolicy=Never \
--set metricsOperator.manager.image.tag=${{ inputs.runtime_tag }} \
--set metricsOperator.manager.image.repository="localhost:5000/keptn/metrics-operator" \
--set lifecycleOperator.manager.env.functionRunnerImage=localhost:5000/keptn/functions-runtime:${{ inputs.runtime_tag }} \
--set lifecycleOperator.manager.env.functionRunnerImage=localhost:5000/keptn/deno-runtime:${{ inputs.runtime_tag }} \
--set lifecycleOperator.manager.env.pythonRunnerImage=localhost:5000/keptn/python-runtime:${{ inputs.runtime_tag }} \
--set certificateOperator.manager.imagePullPolicy=Never \
--set certificateOperator.manager.image.tag=${{ inputs.runtime_tag }} \
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ jobs:
folder: "metrics-operator/"
- name: "scheduler"
folder: "scheduler/"
- name: "functions-runtime"
folder: "functions-runtime/"
- name: "deno-runtime"
folder: "runtimes/deno-runtime/"
- name: "python-runtime"
folder: "python-runtime/"
folder: "runtimes/python-runtime/"
- name: "certificate-operator"
folder: "klt-cert-manager/"
steps:
Expand Down Expand Up @@ -186,14 +186,14 @@ jobs:
run: make controller-gen

- name: Generate release.yaml
if: matrix.config.name != 'functions-runtime' && matrix.config.name != 'python-runtime'
if: matrix.config.name != 'deno-runtime' && matrix.config.name != 'python-runtime'
working-directory: ./${{ matrix.config.folder }}
env:
CHART_APPVERSION: dev-${{ env.DATETIME }}
run: make release-manifests

- name: Upload release.yaml for tests
if: matrix.config.name != 'functions-runtime' && matrix.config.name != 'python-runtime'
if: matrix.config.name != 'deno-runtime' && matrix.config.name != 'python-runtime'
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config.name }}-manifest-test
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_call:
inputs:
runtime_tag:
description: "Tag for the functions runner image"
description: "Tag for the deno runner image"
mowies marked this conversation as resolved.
Show resolved Hide resolved
type: "string"
required: true
helm-install:
Expand All @@ -23,9 +23,6 @@ jobs:
name: Run Integration Tests
runs-on: ubuntu-22.04
steps:
- name: Install monitor action
uses: GitHubSecurityLab/actions-permissions/monitor@v1

- name: Check out code
uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/load-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_call:
inputs:
runtime_tag:
description: "Tag for the functions runner image"
description: "Tag for the deno runner image"
mowies marked this conversation as resolved.
Show resolved Hide resolved
type: "string"
required: true
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/performance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_call:
inputs:
runtime_tag:
description: "Tag for the functions runner image"
description: "Tag for the deno runner image"
mowies marked this conversation as resolved.
Show resolved Hide resolved
type: "string"
required: true
env:
Expand Down
245 changes: 41 additions & 204 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
# renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools
CONTROLLER_TOOLS_VERSION: "v0.12.1"
SCHEDULER_COMPATIBLE_K8S_VERSION: "v0.24.3"
PUBLISHABLE_ITEMS: '[".", "lifecycle-operator", "metrics-operator", "klt-cert-manager", "runtimes/deno-runtime", "runtimes/python-runtime"]'
mowies marked this conversation as resolved.
Show resolved Hide resolved

jobs:
release-please:
Expand Down Expand Up @@ -45,71 +46,53 @@ jobs:
default-branch: main
signoff: "keptn-bot <[email protected]>"

- name: Release Info
run: |
echo "Release KLT: ${{ steps.release.outputs.release_created }}"
echo "Release KLT Cert Manager: ${{ steps.release.outputs.klt-cert-manager--release_created }}"
echo "Release KLT Metrics Operator: ${{ steps.release.outputs.metrics-operator--release_created }}"
echo "Anything to release: ${{ steps.release.outputs.releases_created }}"
echo "Paths to be released: ${{ steps.release.outputs.paths_released }}"

- name: Create build matrix
- name: Create release matrix
id: build-matrix
uses: actions/github-script@v6
env:
RELEASE_KLT: ${{ steps.release.outputs.release_created }}
RELEASE_CERT_MANAGER: ${{ steps.release.outputs.klt-cert-manager--release_created }}
RELEASE_METRICS_OPERATOR: ${{ steps.release.outputs.metrics-operator--release_created }}
CHANGED_ITEMS: ${{ steps.release.outputs.paths_released }}
KLT_TAG: ${{ steps.release.outputs.tag_name }}
CERT_MANAGER_TAG: ${{ steps.release.outputs.klt-cert-manager--tag_name }}
METRICS_OPERATOR_TAG: ${{ steps.release.outputs.metrics-operator--tag_name }}
ARTIFACT_TAG_NAME: ${{ steps.release.outputs[format('{0}--tag_name', steps.release.outputs.paths_released[0])] }}
with:
script: |
const { RELEASE_KLT, RELEASE_CERT_MANAGER, RELEASE_METRICS_OPERATOR, KLT_TAG, CERT_MANAGER_TAG, METRICS_OPERATOR_TAG } = process.env

var result = []
if (RELEASE_KLT === "true") {
result.push(...[
{
name: "lifecycle-operator",
folder: "lifecycle-operator/",
tagName: KLT_TAG
},
{
name: "scheduler",
folder: "scheduler/",
tagName: KLT_TAG
},
{
name: "functions-runtime",
folder: "functions-runtime/",
tagName: KLT_TAG
},
{
name: "python-runtime",
folder: "python-runtime/",
tagName: KLT_TAG
const changedItems = JSON.parse(process.env.CHANGED_ITEMS || '[]');
console.log("changed items", changedItems);
const eligibleItems = JSON.parse(process.env.PUBLISHABLE_ITEMS || '[]');
console.log("eligible items", eligibleItems);
const itemsToPublish = changedItems.filter(i => eligibleItems.includes(i));
console.log("items to publish", itemsToPublish);

console.log("setting up build matrix...");
const releaseMatrix = itemsToPublish.map(item => {
mowies marked this conversation as resolved.
Show resolved Hide resolved
switch (item) {
case "lifecycle-operator":
return [
{
name: item,
folder: item,
tagName: process.env.ARTIFACT_TAG_NAME
},
{
name: "scheduler",
folder: "scheduler/",
tagName: process.env.ARTIFACT_TAG_NAME
}
];
case "metrics-operator":
case "klt-cert-manager":
case "runtimes/deno-runtime":
case "runtimes/python-runtime":
return [{
mowies marked this conversation as resolved.
Show resolved Hide resolved
name: item,
folder: item,
tagName: process.env.ARTIFACT_TAG_NAME
}];
case ".":
default:
return [];
}
])
}

if (RELEASE_CERT_MANAGER === "true") {
result.push({
name: "certificate-operator",
folder: "klt-cert-manager/",
tagName: CERT_MANAGER_TAG
})
}

if (RELEASE_METRICS_OPERATOR === "true") {
result.push({
name: "metrics-operator",
folder: "metrics-operator/",
tagName: METRICS_OPERATOR_TAG
})
}

return { config: result }
});
return releaseMatrix;

build-release:
if: needs.release-please.outputs.releases-created == 'true'
Expand Down Expand Up @@ -200,152 +183,6 @@ jobs:
tag_name: ${{ matrix.config.tagName }}
files: ./sbom-${{ matrix.config.name }}.spdx.json

release-manifests:
RealAnna marked this conversation as resolved.
Show resolved Hide resolved
if: needs.release-please.outputs.releases-created == 'true'
needs:
- release-please
- build-release
runs-on: ubuntu-22.04
steps:
- name: Install monitor action
uses: GitHubSecurityLab/actions-permissions/monitor@v1

- name: Checkout
uses: actions/checkout@v3

- name: Cache build tools lifecycle-operator
if: needs.release-please.outputs.klt-release-created == 'true'
id: cache-build-tools-lifecycle-operator
uses: actions/cache@v3
with:
path: ./lifecycle-operator/bin
key: build-tools-${{ github.ref_name }}

- name: Cache build tools metrics-operator
if: needs.release-please.outputs.metrics-operator-release-created == 'true'
id: cache-build-tools-metrics-operator
uses: actions/cache@v3
with:
path: ./metrics-operator/bin
key: build-tools-${{ github.ref_name }}

- name: Cache build tools scheduler
if: needs.release-please.outputs.klt-release-created == 'true'
id: cache-build-tools-scheduler
uses: actions/cache@v3
with:
path: ./scheduler/bin
key: build-tools-${{ github.ref_name }}

- name: Cache build tools cert-manager
if: needs.release-please.outputs.cert-manager-release-created == 'true'
id: cache-build-tools-klt-cert-manager
uses: actions/cache@v3
with:
path: ./klt-cert-manager/bin
key: build-tools-${{ github.ref_name }}

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true

- name: Create KLT manifest
if: needs.release-please.outputs.klt-release-created == 'true'
env:
RELEASE_REGISTRY: ghcr.io/keptn
CHART_APPVERSION: ${{ needs.release-please.outputs.klt-tag-name }}
run: |
cd scheduler
make release-manifests
cd ../lifecycle-operator
make controller-gen release-manifests
cd ../klt-cert-manager
make controller-gen release-manifests
cd ../metrics-operator
make controller-gen release-manifests
cd ..
echo "---" >> lifecycle-operator/config/rendered/release.yaml
echo "---" >> scheduler/config/rendered/release.yaml
echo "---" >> klt-cert-manager/config/rendered/release.yaml
cat >> namespace.yaml << EOF
---
apiVersion: v1
kind: Namespace
metadata:
name: keptn-lifecycle-toolkit-system
---
EOF
cat namespace.yaml \
lifecycle-operator/config/rendered/release.yaml \
scheduler/config/rendered/release.yaml \
klt-cert-manager/config/rendered/release.yaml \
metrics-operator/config/rendered/release.yaml > klt-manifest.yaml

- name: Create Cert-Manager manifest
if: needs.release-please.outputs.cert-manager-release-created == 'true'
env:
RELEASE_REGISTRY: ghcr.io/keptn
CHART_APPVERSION: ${{ needs.release-please.outputs.cert-manager-tag-name }}
run: |
cd klt-cert-manager
make controller-gen release-manifests
cd ..
echo "---" >> klt-cert-manager/config/rendered/release.yaml
cat >> namespace.yaml << EOF
---
apiVersion: v1
kind: Namespace
metadata:
name: keptn-lifecycle-toolkit-system
---
EOF
cat namespace.yaml \
klt-cert-manager/config/rendered/release.yaml > cert-manager-manifest.yaml

- name: Create Metrics Operator manifest
if: needs.release-please.outputs.metrics-operator-release-created == 'true'
env:
RELEASE_REGISTRY: ghcr.io/keptn
CHART_APPVERSION: ${{ needs.release-please.outputs.metrics-operator-tag-name }}
run: |
cd metrics-operator
make controller-gen release-manifests
cd ..
echo "---" >> metrics-operator/config/rendered/release.yaml
cat >> namespace.yaml << EOF
---
apiVersion: v1
kind: Namespace
metadata:
name: keptn-lifecycle-toolkit-system
---
EOF
cat namespace.yaml \
metrics-operator/config/rendered/release.yaml > metrics-operator-manifest.yaml

- name: Attach KLT release assets
if: needs.release-please.outputs.klt-release-created == 'true'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.release-please.outputs.klt-tag-name }}
files: klt-manifest.yaml

- name: Attach Cert-Manager release assets
if: needs.release-please.outputs.cert-manager-release-created == 'true'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.release-please.outputs.cert-manager-tag-name }}
files: cert-manager-manifest.yaml

- name: Attach Metrics Operator release assets
if: needs.release-please.outputs.metrics-operator-release-created == 'true'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.release-please.outputs.metrics-operator-tag-name }}
files: metrics-operator-manifest.yaml

update-docs:
name: Update Documentation
needs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/security-scans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ jobs:
matrix:
image:
- "functions-runtime"
mowies marked this conversation as resolved.
Show resolved Hide resolved
- "deno-runtime"
- "python-runtime"
- "lifecycle-operator"
- "metrics-operator"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/validate-semantic-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ jobs:
test
deps
scopes: |
main
mowies marked this conversation as resolved.
Show resolved Hide resolved
helm-chart
scheduler
lifecycle-operator
cert-manager
metrics-operator
functions-runtime
deno-runtime
python-runtime
mowies marked this conversation as resolved.
Show resolved Hide resolved
dashboards
examples
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ integration-test: # to run a single test by name use --test eg. --test=expose-ke
kubectl kuttl test --start-kind=false ./test/integration/ --config=kuttl-test.yaml
kubectl kuttl test --start-kind=false ./test/testcertificate/ --config=kuttl-test.yaml



.PHONY: integration-test-local #these tests should run on a real cluster!
integration-test-local: install-prometheus
kubectl kuttl test --start-kind=false ./test/integration/ --config=kuttl-test-local.yaml
Expand All @@ -51,8 +49,6 @@ install-prometheus:
kubectl wait --for=condition=available deployment/kube-state-metrics -n monitoring --timeout=120s
kubectl wait pod/prometheus-k8s-0 --for=condition=ready --timeout=120s -n monitoring



.PHONY: cleanup-manifests
cleanup-manifests:
rm -rf manifests
Expand Down
Loading