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

Development: Add Helios-based deployment workflow for test servers and reusable build logic #10109

Merged
merged 83 commits into from
Jan 29, 2025

Conversation

egekocabas
Copy link
Member

@egekocabas egekocabas commented Jan 6, 2025

Checklist

General

Motivation and Context

This PR adds a new action file testserver-deployment.yml to integrate with the Helios web application for test server deployments. The current label-based approach for triggering deployments will be replaced with this new workflow_dispatch based workflow.

Additionally, the build.yml workflow has been refactored to leverage a reusable workflow file (reusable-build.yml). This ensures consistency across workflows and simplifies future maintenance.

Description

Integration with Helios:

  • The workflow is designed to work with the Helios application, which manages deployment requests.
  • Helios handles locking of test servers and tracking deployment statuses.
  • Helios stays in sync with GitHub through webhook events and periodic automatic syncing, ensuring all repository changes, such as new pull requests or branch updates, are accurately reflected in the Helios interface.

Reusable Build Workflow:

  • Introduced reusable-build.yml to streamline build logic.
  • The build.yml workflow has been updated to utilize this reusable workflow.
  • The new testserver-deployment.yml workflow also utilizes the reusable workflow to handle deployment scenarios where builds are not found.

testserver-deployment.yml:

  • Replaced label-based deployment triggers with a workflow-dispatch approach.
  • Enabled deployments for both PRs and standalone branches.
  • The label-based approach and other related logic will be removed in another PR, which will consolidate the contents of testserver-deployment.yml into testserver.yml.

Once this PR is merged, a follow-up PR will finalize the transition by moving the contents of testserver-deployment.yml into testserver.yml.

@egekocabas egekocabas self-assigned this Jan 6, 2025
@egekocabas egekocabas temporarily deployed to artemis-test7.artemis.cit.tum.de January 6, 2025 05:30 — with GitHub Actions Inactive
@egekocabas egekocabas temporarily deployed to artemis-test7.artemis.cit.tum.de January 6, 2025 06:04 — with GitHub Actions Inactive
@egekocabas egekocabas temporarily deployed to artemis-test7.artemis.cit.tum.de January 6, 2025 08:14 — with GitHub Actions Inactive
@egekocabas egekocabas temporarily deployed to artemis-test7.artemis.cit.tum.de January 6, 2025 08:23 — with GitHub Actions Inactive
@egekocabas egekocabas temporarily deployed to artemis-test7.artemis.cit.tum.de January 6, 2025 09:28 — with GitHub Actions Inactive
@egekocabas egekocabas temporarily deployed to artemis-test7.artemis.cit.tum.de January 6, 2025 10:26 — with GitHub Actions Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test7.artemis.cit.tum.de January 24, 2025 12:05 Inactive
@egekocabas
Copy link
Member Author

I have refactored the build.yml workflow and introduced a new reusable workflow file named reusable-build.yml. The updated build.yml now utilizes this reusable workflow. Additionally, the new deployment action (testserver-deployment.yml) also utilizes the reusable workflow for cases where we don't have the build.

Build workflow runs can be seen in this link.

Once this PR is merged, and the time comes to remove the current labeling logic, we can create another PR to move the contents of the testserver-deployment.yml into testserver.yml. This will finalize the transition to the new workflow structure.

Below are my testing outputs of this new testserver-deployment.yml:

Deployment from a Branch Without a PR

Workflow run: https://github.com/ls1intum/Artemis/actions/runs/12948960943
Branch Name: feature/test-helios-deployment-without-pr
Latest Commit SHA: 825fcb1
Built Docker Image Tag: branch-825fcb13375214f081de1c24958bd8e2c878cb00

image

Deployment from a Branch with a PR

When deploying from a branch with an open pull request, the workflow first verifies whether the latest build was successful. If the build is successful, the deployment proceeds. Otherwise, it fails.

Scenario 1: Build Still Running During Deployment (No Successful Build Found)

Workflow run: https://github.com/ls1intum/Artemis/actions/runs/12949128976
Branch Name: feature/testserver-deployments-with-helios
Latest Commit SHA (at that time): 8d9203d

image

Scenario 2: Successful Build Found

Workflow run: https://github.com/ls1intum/Artemis/actions/runs/12949268370
Branch Name: feature/testserver-deployments-with-helios
Latest Commit SHA (at that time): 8d9203d
Docker Image Tag: pr-10109

image

Note: The new workflow was tested by temporarily modifying the testserver.yml file to enable testing, as the workflow has not yet been merged into the default branch. (See add2b32 and 925a07f)

@egekocabas egekocabas marked this pull request as ready for review January 24, 2025 12:44
@egekocabas egekocabas requested review from krusche and Hialus January 24, 2025 12:44
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 24, 2025
ole-ve
ole-ve previously approved these changes Jan 24, 2025
Copy link
Contributor

@ole-ve ole-ve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for integrating the feedback. code looks good, really like the refactoring 👍

@egekocabas egekocabas dismissed stale reviews from ole-ve and coderabbitai[bot] via 40aef2d January 25, 2025 21:37
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 25, 2025
@egekocabas egekocabas changed the title Development: Add Helios-based deployment workflow for test servers Development: Add Helios-based deployment workflow for test servers and reusable build logic Jan 28, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 28, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 28, 2025
@krusche krusche added this to the 7.9.1 milestone Jan 29, 2025
@krusche krusche merged commit 72ca6ae into develop Jan 29, 2025
12 of 13 checks passed
@krusche krusche deleted the feature/testserver-deployments-with-helios branch January 29, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

4 participants