-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: RunnerSet backed by StatefulSet #629
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
dc0e1bf
feat: RunnerSet backed by StatefulSet
mumoshu aedaab5
Upgrade controller-runtime to 0.9.0
mumoshu 6993a6d
Bump Go to 1.16.x following controller-runtime 0.9.0
mumoshu 2439e91
Upgrade kubebuilder to 2.3.2 for updated etcd and apiserver following…
mumoshu 0cdf017
Fix startup failure due to missing LeaderElectionID
mumoshu 61697b2
Fix the issue that any pods become unable to start once actions-runne…
mumoshu 352c799
Allow force-updating statefulset
mumoshu 1a8e645
Fix runner container missing work and certs-client volume mounts and …
mumoshu 626ba60
Fix runnerset-controller not applying statefulset.spec.template.spec …
mumoshu 3f88ce8
Enable running acceptance tests against arbitrary kind cluster
mumoshu 69b43fa
RunnerSet supports non-ephemeral runners only today
mumoshu 0669ef9
fix: docker-build from root Makefile on intel mac
toast-gear 2d95900
fix: arch check fixes for mac and ARM
callum-tait-pbx 1a15420
ci: aligning test data format and patching checks
callum-tait-pbx 2aac467
fix: removing namespace in test data
callum-tait-pbx a2b9da4
chore: adding more ignores
callum-tait-pbx 35ffe60
chore: removing leading space in shebang
callum-tait-pbx 3c4c6ca
Re-add metrics to org hra testdata
mumoshu 5336e31
Bump cert-manager to v1.1.1 and fix deploy.sh
mumoshu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ config | |
charts | ||
.github | ||
.envrc | ||
.env | ||
*.md | ||
*.txt | ||
*.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,84 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set +e | ||
|
||
runner_name= | ||
repo_runnerdeployment_passed="skipped" | ||
repo_runnerset_passed="skipped" | ||
|
||
while [ -z "${runner_name}" ]; do | ||
echo Finding the runner... 1>&2 | ||
sleep 1 | ||
runner_name=$(kubectl get runner --output=jsonpath="{.items[*].metadata.name}") | ||
done | ||
echo "Checking if RunnerDeployment repo test is set" | ||
if [ "${TEST_REPO}" ] && [ ! "${USE_RUNNERSET}" ]; then | ||
runner_name= | ||
count=0 | ||
while [ $count -le 30 ]; do | ||
echo "Finding Runner ..." | ||
runner_name=$(kubectl get runner --output=jsonpath="{.items[*].metadata.name}") | ||
if [ "${runner_name}" ]; then | ||
while [ $count -le 30 ]; do | ||
runner_pod_name= | ||
echo "Found Runner \""${runner_name}"\"" | ||
echo "Finding underlying pod ..." | ||
runner_pod_name=$(kubectl get pod --output=jsonpath="{.items[*].metadata.name}" | grep ${runner_name}) | ||
if [ "${runner_pod_name}" ]; then | ||
echo "Found underlying pod \""${runner_pod_name}"\"" | ||
echo "Waiting for pod \""${runner_pod_name}"\" to become ready..." | ||
kubectl wait pod/${runner_pod_name} --for condition=ready --timeout 270s | ||
break 2 | ||
fi | ||
sleep 1 | ||
let "count=count+1" | ||
done | ||
fi | ||
sleep 1 | ||
let "count=count+1" | ||
done | ||
if [ $count -ge 30 ]; then | ||
repo_runnerdeployment_passed=false | ||
else | ||
repo_runnerdeployment_passed=true | ||
fi | ||
echo "Checking if RunnerSet repo test is set" | ||
elif [ "${TEST_REPO}" ] && [ "${USE_RUNNERSET}" ]; then | ||
runnerset_name= | ||
count=0 | ||
while [ $count -le 30 ]; do | ||
echo "Finding RunnerSet ..." | ||
runnerset_name=$(kubectl get runnerset --output=jsonpath="{.items[*].metadata.name}") | ||
if [ "${runnerset_name}" ]; then | ||
while [ $count -le 30 ]; do | ||
runnerset_pod_name= | ||
echo "Found RunnerSet \""${runnerset_name}"\"" | ||
echo "Finding underlying pod ..." | ||
runnerset_pod_name=$(kubectl get pod --output=jsonpath="{.items[*].metadata.name}" | grep ${runnerset_name}) | ||
echo "BEFORE IF" | ||
if [ "${runnerset_pod_name}" ]; then | ||
echo "AFTER IF" | ||
echo "Found underlying pod \""${runnerset_pod_name}"\"" | ||
echo "Waiting for pod \""${runnerset_pod_name}"\" to become ready..." | ||
kubectl wait pod/${runnerset_pod_name} --for condition=ready --timeout 270s | ||
break 2 | ||
fi | ||
sleep 1 | ||
let "count=count+1" | ||
done | ||
fi | ||
sleep 1 | ||
let "count=count+1" | ||
done | ||
if [ $count -ge 30 ]; then | ||
repo_runnerset_passed=false | ||
else | ||
repo_runnerset_passed=true | ||
fi | ||
fi | ||
|
||
echo Found runner ${runner_name}. | ||
|
||
# Wait a bit to make sure the runner pod is created before looking for it. | ||
sleep 2 | ||
|
||
pod_name= | ||
|
||
while [ -z "${pod_name}" ]; do | ||
echo Finding the runner pod... 1>&2 | ||
sleep 1 | ||
pod_name=$(kubectl get pod --output=jsonpath="{.items[*].metadata.name}" | grep ${runner_name}) | ||
done | ||
|
||
echo Found pod ${pod_name}. | ||
|
||
echo Waiting for pod ${runner_name} to become ready... 1>&2 | ||
|
||
kubectl wait pod/${runner_name} --for condition=ready --timeout 270s | ||
|
||
echo All tests passed. 1>&2 | ||
if [ ${repo_runnerset_passed} == true ] || [ ${repo_runnerset_passed} == "skipped" ] && \ | ||
[ ${repo_runnerdeployment_passed} == true ] || [ ${repo_runnerdeployment_passed} == "skipped" ]; then | ||
echo "INFO : All tests passed or skipped" | ||
echo "RunnerSet Repo Test Status : ${repo_runnerset_passed}" | ||
echo "RunnerDeployment Repo Test Status : ${repo_runnerdeployment_passed}" | ||
else | ||
echo "ERROR : Some tests failed" | ||
echo "RunnerSet Repo Test Status : ${repo_runnerset_passed}" | ||
echo "RunnerDeployment Repo Test Status : ${repo_runnerdeployment_passed}" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
apiVersion: actions.summerwind.dev/v1alpha1 | ||
kind: RunnerSet | ||
metadata: | ||
name: example-runnerset | ||
spec: | ||
# MANDATORY because it is based on StatefulSet: Results in a below error when omitted: | ||
# missing required field "selector" in dev.summerwind.actions.v1alpha1.RunnerSet.spec | ||
selector: | ||
matchLabels: | ||
app: example-runnerset | ||
|
||
# MANDATORY because it is based on StatefulSet: Results in a below error when omitted: | ||
# missing required field "serviceName" in dev.summerwind.actions.v1alpha1.RunnerSet.spec] | ||
serviceName: example-runnerset | ||
|
||
#replicas: 1 | ||
ephemeral: false | ||
|
||
repository: ${TEST_REPO} | ||
# | ||
# Custom runner image | ||
# | ||
image: ${RUNNER_NAME}:${RUNNER_TAG} | ||
# | ||
# dockerd within runner container | ||
# | ||
## Replace `mumoshu/actions-runner-dind:dev` with your dind image | ||
#dockerdWithinRunnerContainer: true | ||
# | ||
# Set the MTU used by dockerd-managed network interfaces (including docker-build-ubuntu) | ||
# | ||
#dockerMTU: 1450 | ||
#Runner group | ||
# labels: | ||
# - "mylabel 1" | ||
# - "mylabel 2" | ||
|
||
# | ||
# Non-standard working directory | ||
# | ||
# workDir: "/" | ||
template: | ||
metadata: | ||
labels: | ||
app: example-runnerset | ||
spec: | ||
containers: | ||
- name: runner | ||
imagePullPolicy: IfNotPresent | ||
#- name: docker | ||
# #image: mumoshu/actions-runner-dind:dev |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
if all the images used in
acceptance/load
aren't already on your local machine then this fails.acceptance/pull
needs to be done afteracceptance/kind