Skip to content

Commit

Permalink
Merge pull request #131 from perftool-incubator/dev-kmr
Browse files Browse the repository at this point in the history
  • Loading branch information
k-rister authored Aug 4, 2024
2 parents 2c36654 + ab2131f commit 4893136
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .github/actions/install-crucible/install-crucible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ case "${CI_ENDPOINT}" in
k8s)
if [ ${AUTH_TOKEN_FILE_FOUND} == 0 ]; then
start_github_group "Configuring Crucible for local k8s registry"
CONTAINER_REGISTRY="localhost:32000/client-server"
CONTAINER_REGISTRY="localhost:32000/engines"
REGISTRY_TLS_VERIFY="false"
stop_github_group
fi
;;
remotehost)
if [ ${AUTH_TOKEN_FILE_FOUND} == 0 ]; then
start_github_group "Configuring Crucible for local remotehost registry"
CONTAINER_REGISTRY="dir:/home/crucible-containers/client-server"
CONTAINER_REGISTRY="dir:/home/crucible-containers/engines"
stop_github_group
fi
;;
Expand Down
38 changes: 20 additions & 18 deletions .github/actions/integration-tests/run-ci-stage1
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,20 @@ if [ ! -d "${CRUCIBLE_HOME}" ]; then
exit 1
fi

CRUCIBLE_CLIENT_SERVER_REPO_LOCATION=""
if echo "${CRUCIBLE_CLIENT_SERVER_REPO}" | grep -q "dir:"; then
CRUCIBLE_CLIENT_SERVER_REPO_LOCATION="local"
CRUCIBLE_CLIENT_SERVER_REPO=$(echo "${CRUCIBLE_CLIENT_SERVER_REPO}" | sed -e "s/dir://" -e 's|/client-server$||')
elif echo "${CRUCIBLE_CLIENT_SERVER_REPO}" | grep -q "quay.io"; then
CRUCIBLE_CLIENT_SERVER_REPO_LOCATION="quay.io"
# provide backwards compatibility with configration files that still
# have CRUCIBLE_CLIENT_SERVER_* instead of CRUCIBLE_ENGINE_*
if [ -z "${CRUCIBLE_ENGINE_REPO}" -a -n "${CRUCIBLE_CLIENT_SERVER_REPO}" ]; then
CRUCIBLE_ENGINE_REPO=${CRUCIBLE_CLIENT_SERVER_REPO}
fi

CRUCIBLE_ENGINE_REPO_LOCATION=""
if echo "${CRUCIBLE_ENGINE_REPO}" | grep -q "dir:"; then
CRUCIBLE_ENGINE_REPO_LOCATION="local"
CRUCIBLE_ENGINE_REPO=$(echo "${CRUCIBLE_ENGINE_REPO}" | sed -e "s/dir://" -e 's|/engines$||')
elif echo "${CRUCIBLE_ENGINE_REPO}" | grep -q "quay.io"; then
CRUCIBLE_ENGINE_REPO_LOCATION="quay.io"
else
CRUCIBLE_CLIENT_SERVER_REPO_LOCATION="microk8s"
CRUCIBLE_ENGINE_REPO_LOCATION="microk8s"
fi

CI_RUN_ENVIRONMENT="standalone"
Expand Down Expand Up @@ -267,9 +273,7 @@ function post_run_cmd {
}

function remove_microk8s_images {
local rc=1

for image in $(do_ssh ${CI_ENDPOINT_USER}@${CI_ENDPOINT_HOST} microk8s ctr images list "name~=client-server" | grep -v REF | awk '{ print $1 }'); do
for image in $(do_ssh ${CI_ENDPOINT_USER}@${CI_ENDPOINT_HOST} microk8s ctr images list "name~=engines" | grep -v REF | awk '{ print $1 }'); do
do_ssh ${CI_ENDPOINT_USER}@${CI_ENDPOINT_HOST} microk8s ctr images remove --sync ${image}
rc=$?

Expand All @@ -278,8 +282,6 @@ function remove_microk8s_images {
break
fi
done

return ${rc}
}

if [ "${CI_BUILD_CONTROLLER}" == "yes" ]; then
Expand Down Expand Up @@ -599,15 +601,15 @@ for userenv in ${CI_ACTIVE_USERENVS}; do
k8s)
case "${CI_K8S_TYPE}" in
"MICROK8S")
if [ "${CRUCIBLE_CLIENT_SERVER_REPO_LOCATION}" == "microk8s" ]; then
if [ "${CRUCIBLE_ENGINE_REPO_LOCATION}" == "microk8s" ]; then
run_cmd "remove_microk8s_images"
fi
;;
esac
;;
remotehost)
if [ "${CRUCIBLE_CLIENT_SERVER_REPO_LOCATION}" == "local" ]; then
run_cmd "rm -Rfv ${CRUCIBLE_CLIENT_SERVER_REPO}/*"
if [ "${CRUCIBLE_ENGINE_REPO_LOCATION}" == "local" ]; then
run_cmd "rm -Rfv ${CRUCIBLE_ENGINE_REPO}/*"
fi
;;
esac
Expand Down Expand Up @@ -658,15 +660,15 @@ case "${CI_ENDPOINT}" in

case "${CI_K8S_TYPE}" in
"MICROK8S")
if [ "${CRUCIBLE_CLIENT_SERVER_REPO_LOCATION}" == "microk8s" ]; then
if [ "${CRUCIBLE_ENGINE_REPO_LOCATION}" == "microk8s" ]; then
run_cmd "do_ssh ${CI_ENDPOINT_USER}@${CI_ENDPOINT_HOST} microk8s ctr images list" "force"
fi
;;
esac
;;
remotehost)
if [ "${CRUCIBLE_CLIENT_SERVER_REPO_LOCATION}" == "local" ]; then
run_cmd "ls -laR ${CRUCIBLE_CLIENT_SERVER_REPO}" "force"
if [ "${CRUCIBLE_ENGINE_REPO_LOCATION}" == "local" ]; then
run_cmd "ls -laR ${CRUCIBLE_ENGINE_REPO}" "force"
fi
;;
esac
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/benchmark-crucible-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ jobs:

- name: import ci secret
env:
CLIENT_SERVER_REGISTRY_AUTH_SECRET: ${{ secrets.registry_auth != '' && secrets.registry_auth || secrets.ci_registry_auth }}
if: ${{ env.CLIENT_SERVER_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$CLIENT_SERVER_REGISTRY_AUTH_SECRET\" > /root/crucible-ci-engines-token.json"
ENGINE_REGISTRY_AUTH_SECRET: ${{ secrets.registry_auth != '' && secrets.registry_auth || secrets.ci_registry_auth }}
if: ${{ env.ENGINE_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$ENGINE_REGISTRY_AUTH_SECRET\" > /root/crucible-ci-engines-token.json"
- name: import production secret
env:
CLIENT_SERVER_REGISTRY_AUTH_SECRET: ${{ secrets.production_registry_auth }}
if: ${{ env.CLIENT_SERVER_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$CLIENT_SERVER_REGISTRY_AUTH_SECRET\" > /root/crucible-production-engines-token.json"
ENGINE_REGISTRY_AUTH_SECRET: ${{ secrets.production_registry_auth }}
if: ${{ env.ENGINE_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$ENGINE_REGISTRY_AUTH_SECRET\" > /root/crucible-production-engines-token.json"

- name: import quay oath token
env:
Expand Down Expand Up @@ -212,14 +212,14 @@ jobs:

- name: import ci secret
env:
CLIENT_SERVER_REGISTRY_AUTH_SECRET: ${{ secrets.registry_auth != '' && secrets.registry_auth || secrets.ci_registry_auth }}
if: ${{ env.CLIENT_SERVER_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$CLIENT_SERVER_REGISTRY_AUTH_SECRET\" > /root/crucible-ci-engines-token.json"
ENGINE_REGISTRY_AUTH_SECRET: ${{ secrets.registry_auth != '' && secrets.registry_auth || secrets.ci_registry_auth }}
if: ${{ env.ENGINE_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$ENGINE_REGISTRY_AUTH_SECRET\" > /root/crucible-ci-engines-token.json"
- name: import production secret
env:
CLIENT_SERVER_REGISTRY_AUTH_SECRET: ${{ secrets.production_registry_auth }}
if: ${{ env.CLIENT_SERVER_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$CLIENT_SERVER_REGISTRY_AUTH_SECRET\" > /root/crucible-production-engines-token.json"
ENGINE_REGISTRY_AUTH_SECRET: ${{ secrets.production_registry_auth }}
if: ${{ env.ENGINE_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$ENGINE_REGISTRY_AUTH_SECRET\" > /root/crucible-production-engines-token.json"

- name: import quay oath token
env:
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/core-crucible-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,14 @@ jobs:

- name: import ci secret
env:
CLIENT_SERVER_REGISTRY_AUTH_SECRET: ${{ secrets.registry_auth != '' && secrets.registry_auth || secrets.ci_registry_auth }}
if: ${{ needs.gen-params.outputs.build_controller == 'yes' && env.CLIENT_SERVER_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$CLIENT_SERVER_REGISTRY_AUTH_SECRET\" > /root/crucible-ci-engines-token.json"
ENGINE_REGISTRY_AUTH_SECRET: ${{ secrets.registry_auth != '' && secrets.registry_auth || secrets.ci_registry_auth }}
if: ${{ needs.gen-params.outputs.build_controller == 'yes' && env.ENGINE_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$ENGINE_REGISTRY_AUTH_SECRET\" > /root/crucible-ci-engines-token.json"
- name: import production secret
env:
CLIENT_SERVER_REGISTRY_AUTH_SECRET: ${{ secrets.production_registry_auth }}
if: ${{ needs.gen-params.outputs.build_controller == 'yes' && env.CLIENT_SERVER_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$CLIENT_SERVER_REGISTRY_AUTH_SECRET\" > /root/crucible-production-engines-token.json"
ENGINE_REGISTRY_AUTH_SECRET: ${{ secrets.production_registry_auth }}
if: ${{ needs.gen-params.outputs.build_controller == 'yes' && env.ENGINE_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$ENGINE_REGISTRY_AUTH_SECRET\" > /root/crucible-production-engines-token.json"

- name: import quay oath token
env:
Expand Down Expand Up @@ -289,14 +289,14 @@ jobs:

- name: import ci secret
env:
CLIENT_SERVER_REGISTRY_AUTH_SECRET: ${{ secrets.registry_auth != '' && secrets.registry_auth || secrets.ci_registry_auth }}
if: ${{ env.CLIENT_SERVER_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$CLIENT_SERVER_REGISTRY_AUTH_SECRET\" > /root/crucible-ci-engines-token.json"
ENGINE_REGISTRY_AUTH_SECRET: ${{ secrets.registry_auth != '' && secrets.registry_auth || secrets.ci_registry_auth }}
if: ${{ env.ENGINE_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$ENGINE_REGISTRY_AUTH_SECRET\" > /root/crucible-ci-engines-token.json"
- name: import production secret
env:
CLIENT_SERVER_REGISTRY_AUTH_SECRET: ${{ secrets.production_registry_auth }}
if: ${{ env.CLIENT_SERVER_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$CLIENT_SERVER_REGISTRY_AUTH_SECRET\" > /root/crucible-production-engines-token.json"
ENGINE_REGISTRY_AUTH_SECRET: ${{ secrets.production_registry_auth }}
if: ${{ env.ENGINE_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$ENGINE_REGISTRY_AUTH_SECRET\" > /root/crucible-production-engines-token.json"

- name: import quay oath token
env:
Expand Down Expand Up @@ -366,14 +366,14 @@ jobs:

- name: import ci secret
env:
CLIENT_SERVER_REGISTRY_AUTH_SECRET: ${{ secrets.registry_auth != '' && secrets.registry_auth || secrets.ci_registry_auth }}
if: ${{ env.CLIENT_SERVER_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$CLIENT_SERVER_REGISTRY_AUTH_SECRET\" > /root/crucible-ci-engines-token.json"
ENGINE_REGISTRY_AUTH_SECRET: ${{ secrets.registry_auth != '' && secrets.registry_auth || secrets.ci_registry_auth }}
if: ${{ env.ENGINE_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$ENGINE_REGISTRY_AUTH_SECRET\" > /root/crucible-ci-engines-token.json"
- name: import production secret
env:
CLIENT_SERVER_REGISTRY_AUTH_SECRET: ${{ secrets.production_registry_auth }}
if: ${{ env.CLIENT_SERVER_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$CLIENT_SERVER_REGISTRY_AUTH_SECRET\" > /root/crucible-production-engines-token.json"
ENGINE_REGISTRY_AUTH_SECRET: ${{ secrets.production_registry_auth }}
if: ${{ env.ENGINE_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$ENGINE_REGISTRY_AUTH_SECRET\" > /root/crucible-production-engines-token.json"

- name: import quay oath token
env:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tool-crucible-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ jobs:

- name: import ci secret
env:
CLIENT_SERVER_REGISTRY_AUTH_SECRET: ${{ secrets.registry_auth != '' && secrets.registry_auth || secrets.ci_registry_auth }}
if: ${{ env.CLIENT_SERVER_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$CLIENT_SERVER_REGISTRY_AUTH_SECRET\" > /root/crucible-ci-engines-token.json"
ENGINE_REGISTRY_AUTH_SECRET: ${{ secrets.registry_auth != '' && secrets.registry_auth || secrets.ci_registry_auth }}
if: ${{ env.ENGINE_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$ENGINE_REGISTRY_AUTH_SECRET\" > /root/crucible-ci-engines-token.json"
- name: import production secret
env:
CLIENT_SERVER_REGISTRY_AUTH_SECRET: ${{ secrets.production_registry_auth }}
if: ${{ env.CLIENT_SERVER_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$CLIENT_SERVER_REGISTRY_AUTH_SECRET\" > /root/crucible-production-engines-token.json"
ENGINE_REGISTRY_AUTH_SECRET: ${{ secrets.production_registry_auth }}
if: ${{ env.ENGINE_REGISTRY_AUTH_SECRET != '' }}
run: sudo bash -c "echo \"$ENGINE_REGISTRY_AUTH_SECRET\" > /root/crucible-production-engines-token.json"

- name: import quay oath token
env:
Expand Down

0 comments on commit 4893136

Please sign in to comment.