-
Notifications
You must be signed in to change notification settings - Fork 291
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
Infrastructure
: Add pull request deployment using Helm
#9618
base: develop
Are you sure you want to change the base?
Conversation
Signed-off-by: Colin Wilk <[email protected]>
WalkthroughThe pull request introduces several changes to the Helm chart for the Artemis application. A new entry, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Helm
participant Application
User->>Helm: Deploy Artemis Chart
Helm->>Application: Check service type (Ingress, NodePort, LoadBalancer, ClusterIP)
Application-->>Helm: Return service details
Helm-->>User: Provide access instructions based on service type
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
⛔ Files ignored due to path filters (35)
.github/workflows/helm_pr_deployment.yml
is excluded by!**/*.yml
.github/workflows/helm_pr_deployment_delete.yml
is excluded by!**/*.yml
helm/artemis/Chart.lock
is excluded by!**/*.lock
,!**/*.lock
helm/artemis/Chart.yaml
is excluded by!**/*.yaml
helm/artemis/templates/autoscaler/horizontal-pod-autoscaler.yml
is excluded by!**/*.yml
helm/artemis/templates/configmaps/activemq-broker-configmap.yml
is excluded by!**/*.yml
helm/artemis/templates/configmaps/artemis-ci-configmap.yml
is excluded by!**/*.yml
helm/artemis/templates/configmaps/artemis-configmap.yml
is excluded by!**/*.yml
helm/artemis/templates/configmaps/artemis-mysql-configmap.yml
is excluded by!**/*.yml
helm/artemis/templates/configmaps/artemis-usermanagement-configmap.yml
is excluded by!**/*.yml
helm/artemis/templates/configmaps/artemis-vcs-configmap.yml
is excluded by!**/*.yml
helm/artemis/templates/configmaps/jhipster-registry-configmap.yml
is excluded by!**/*.yml
helm/artemis/templates/configmaps/jhipster-registry-env-configmap.yml
is excluded by!**/*.yml
helm/artemis/templates/deployments/_artemis-deployment.yml
is excluded by!**/*.yml
helm/artemis/templates/deployments/activemq-broker.yml
is excluded by!**/*.yml
helm/artemis/templates/deployments/artemis-deployment-profile.yaml
is excluded by!**/*.yaml
helm/artemis/templates/deployments/artemis-deployment.yaml
is excluded by!**/*.yaml
helm/artemis/templates/ingresses/ingress.yaml
is excluded by!**/*.yaml
helm/artemis/templates/monitors/podmonitor.yml
is excluded by!**/*.yml
helm/artemis/templates/pvc/artemis-mysql.yml
is excluded by!**/*.yml
helm/artemis/templates/pvc/artemis.yml
is excluded by!**/*.yml
helm/artemis/templates/secrets/activemq-broker-secrets.yml
is excluded by!**/*.yml
helm/artemis/templates/secrets/artemis-secrets.yml
is excluded by!**/*.yml
helm/artemis/templates/secrets/artemis-usermanagement-secrets.yml
is excluded by!**/*.yml
helm/artemis/templates/secrets/jhipster-registry-secrets.yml
is excluded by!**/*.yml
helm/artemis/templates/services/activemq-broker-service.yml
is excluded by!**/*.yml
helm/artemis/templates/services/artemis-service-profile.yaml
is excluded by!**/*.yaml
helm/artemis/templates/services/artemis-service.yaml
is excluded by!**/*.yaml
helm/artemis/templates/services/jhipster-registry-service.yaml
is excluded by!**/*.yaml
helm/artemis/templates/services/mysql-service.yaml
is excluded by!**/*.yaml
helm/artemis/templates/statefulsets/artemis-mysql.yml
is excluded by!**/*.yml
helm/artemis/templates/statefulsets/artemis-statefulset.yaml
is excluded by!**/*.yaml
helm/artemis/templates/statefulsets/jhipster-registry.yml
is excluded by!**/*.yml
helm/artemis/templates/tests/test-connection.yaml
is excluded by!**/*.yaml
helm/artemis/values.yaml
is excluded by!**/*.yaml
📒 Files selected for processing (3)
- helm/.gitignore (1 hunks)
- helm/artemis/templates/NOTES.txt (1 hunks)
- helm/artemis/templates/_helpers.tpl (1 hunks)
🧰 Additional context used
🪛 LanguageTool
helm/artemis/templates/NOTES.txt
[uncategorized] ~9-~9: Loose punctuation mark.
Context: ...ervices {{ include "artemis.fullname" . }}) export NODE_IP=$(kubectl get nodes ...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~14-~14: Loose punctuation mark.
Context: ... svc -w {{ include "artemis.fullname" . }}' export SERVICE_IP=$(kubectl get svc...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~15-~15: Loose punctuation mark.
Context: ...pace }} {{ include "artemis.fullname" . }} --template "{{"{{ range (index .status...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~18-~18: Loose punctuation mark.
Context: ...tes.io/name={{ include "artemis.name" . }},app.kubernetes.io/instance={{ .Release...(UNLIKELY_OPENING_PUNCTUATION)
🔇 Additional comments (6)
helm/artemis/templates/_helpers.tpl (6)
1-6
: LGTM: Name template follows Helm best practicesThe implementation correctly handles name overrides and follows Kubernetes naming conventions.
8-24
: LGTM: Fullname template handles all edge casesThe implementation properly handles all name override scenarios and follows Kubernetes naming conventions.
26-31
: LGTM: Chart name template handles version formatting correctlyThe implementation properly sanitizes version strings and follows naming conventions.
45-51
: LGTM: Selector labels follow Kubernetes best practicesThe implementation includes the minimum required labels for reliable pod selection.
53-62
: LGTM: Service account naming logic is correctThe implementation properly handles service account creation and naming scenarios.
1-82
: Verify template usage in other Helm resourcesThe helper templates look good overall. Let's verify their usage across the Helm chart.
✅ Verification successful
Let me gather more specific information about the template usage to verify their correctness.
Helper templates are correctly used across the Helm chart
The verification shows that all helper templates defined in
_helpers.tpl
are properly used across the Helm chart resources:
artemis.name
is used for app name labels and pod selectorsartemis.fullname
is consistently used for resource naming across deployments, services, and other resourcesartemis.labels
is properly indented and used for metadata labelsartemis.selectorLabels
is correctly applied in pod templates and service selectorsartemis.springprofiles
is properly used in configmaps and statefulsets for Spring profile configurationThe templates follow Helm best practices with proper indentation and consistent usage patterns.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of template functions across the Helm chart echo "Checking template function usage..." rg -l "include \"artemis\." helm/artemis/templates/ echo "Checking for potential template syntax errors..." rg -l "{{-?\s*include\s+[\"']artemis\.[^\"']+[\"']\s*\." helm/artemis/templates/ | \ while read -r file; do echo "Analyzing $file..." cat "$file" | grep -n "{{-\?\s*include\s\+\"artemis\." doneLength of output: 1157
Script:
#!/bin/bash # Check specific template function usage patterns echo "Checking artemis.name usage..." rg "include \"artemis.name\"" helm/artemis/templates/ -A 1 echo -e "\nChecking artemis.fullname usage..." rg "include \"artemis.fullname\"" helm/artemis/templates/ -A 1 echo -e "\nChecking artemis.labels usage..." rg "include \"artemis.labels\"" helm/artemis/templates/ -A 1 echo -e "\nChecking artemis.selectorLabels usage..." rg "include \"artemis.selectorLabels\"" helm/artemis/templates/ -A 1 echo -e "\nChecking artemis.serviceAccountName usage..." rg "include \"artemis.serviceAccountName\"" helm/artemis/templates/ -A 1 echo -e "\nChecking artemis.springprofiles usage..." rg "include \"artemis.springprofiles\"" helm/artemis/templates/ -A 1Length of output: 8263
🚀 Deployed PR #9618 to https://pr9618.artemis-k8s.ase.cit.tum.de ⏳ It might take up to 10 minutes to fully start up. |
🚀 Deployed PR #9618 to https://pr9618.artemis-k8s.ase.cit.tum.de ⏳ It might take up to 10 minutes to fully start up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked through the GitHub action parts and left some small notes.
Some general stuff:
- Please also document this on Confluence
- Please add a motivation to your PR description
- How can devs log into the test servers?
- You are currently 250+ commits behind develop
3e4799a
to
23d1004
Compare
Bump versions for Chart and appVersion. Signed-off-by: Colin Wilk <[email protected]>
Add url for k8s env Signed-off-by: Colin Wilk <[email protected]>
🚀 Deployed PR #9618 to https://pr9618.artemis-k8s.ase.cit.tum.de ⏳ It might take up to 10 minutes to fully start up. |
🚀 Deployed PR #9618 to https://pr9618.artemis-k8s.ase.cit.tum.de ⏳ It might take up to 10 minutes to fully start up. |
Add condition to check if delpoy:k8s tag exists for the PR Signed-off-by: Colin Wilk <[email protected]>
🚀 Deployed PR #9618 to https://pr9618.artemis-k8s.ase.cit.tum.de ⏳ It might take up to 10 minutes to fully start up. |
Please add it to the documentation inside the repo -> https://docs.artemis.cit.tum.de/dev/testservers.html File path: |
Signed-off-by: Colin Wilk <[email protected]>
Set cancel-in-progress to true so that in scenarios where commits are pushed fast or multiple tags are added at once we only run the most recent pipeline. Signed-off-by: Colin Wilk <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change! I think this will really make the test flow much smoother and would also allow to have new DBs for every test 😍
RE: Automatically deploy to K8s and not wait for admin (mtze) approval. I think in order to really profit from this enhancement, the student must be trusted enough to deploy to K8s at their own will. Potentially, this opens up the option for deployers/students to run any pod with any functionality on the cluster by modifying the helm charts. In the system, any abuse can be detected using logs and analytics, tracked to the student, and disciplinary actions can take place. Thus, I see no problem here.
When adding multiple labels at the same time, the job is currently executing multiple times. After removing the barrier of manual approval, this would re-deploy the commit multiple times drastically increasing setup time. Please make sure that the job only successfully executed exactly once 👍
Thanks for the Feedback!
This should be fixed with the cancel-in-progress setting in f4da4ed Regarding the Approvals: Anybody with admin access can change this in the Environments - this does not require any changes to my pr. |
🚀 Deployed PR #9618 to https://pr9618.artemis-k8s.ase.cit.tum.de ⏳ It might take up to 10 minutes to fully start up. |
When a developer or tester wants to verify that the changes work on a newly set up environment, this is a great addition. However, I see a few challenges / limitations:
Please mention those limitations as part of the PR and the documentation so everyone has a good understanding of the advantages and limitations of the new deployment option! |
Checklist
General
Server
None
Client
None
Changes affecting Programming Exercises
None
Description
This Pull Request merges the Helm chart from https://github.com/ls1intum/artemis-helm with my changes proposed in ls1intum/artemis-helm#18 and adds GitHub action workflows to continuously deploy pull requests to Kubernetes.
Problem
Artemis incorporates Continuous Delivery in its development workflow to perform
testing and Quality Assurance on code.
In the existing architecture, the administrators maintain over 20 virtual
machines with different version control systems and continuous integration systems for Artemis test
servers to deploy the pull requests on.
scaling those instances is a manual process limiting the number of available
test instances.
Often, the instances are not redeployed after every code review, which is
prone to configuration drift over time, leading to broken test servers and deployment related errors during
pull request deployment review.
Motivation
The advancements in modern software deployment practices, epitomized by adopting
containerization and orchestration technologies such as Kubernetes, underscore a
pivotal shift towards more efficient, reliable, and scalable application
management.
The deployment and continuous development of complex
platforms like Artemis encapsulates the pressing need for deployment
architectures that not only scale but also simplify operational complexities.
Leveraging Kubernetes to scale and manage Artemis' pull request
deployments transforms Artemis's quality assurance workflow.
This approach mitigates the configuration drift and enhances the efficiency and
reliability of testing environments.
Developers can assure higher quality standards and faster iteration cycles by
enabling on-demand, scalable test instances.
This is critical in an academic setting where the platform's stability and
functionality directly affect the learning outcomes and overall user experience.
Changes to the Helm Chart:
Dependencies Updated:
prometheus
dependency inChart.lock
.artemisVersion
to7.5.0
invalues.yaml
.Template Updates:
_helpers.tpl
.artemis-ci-configmap.yml
with new continuous integration parameters.artemis-configmap.yml
to include JWT for registry security.artemis-vcs-configmap.yml
to support a more generic version control configurations.Deployment Changes
activemq-broker
,artemis-mysql.yml
, andjhipster-registry
configurable via values.yaml (Introduced resource requests and limits forartemis
,database
,registry
, andbroker
.)_artemis-deployment.yml
andartemis-statefulset.yaml
.These changes incorporate configuration values of newer Artemis releases coming from the artemis ansible collection https://github.com/ls1intum/artemis-ansible-collection.
Testing
Check this PR deployment.
Summary by CodeRabbit
Summary by CodeRabbit
New Features
NOTES.txt
file with detailed instructions for accessing the Artemis application based on service type.Chores
.gitignore
file to exclude files and directories namedcharts
.