Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .pipelines/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ cd $DIR/../build/linux
echo "----------- Build Docker Provider -------------------------------"
make
cd $DIR

echo "------------ Bundle Shell Extension Scripts & HELM chart -------------------------"
cd $DIR/../deployment/arc-k8s-extension/ServiceGroupRoot/Scripts
tar -czvf ../artifacts.tar.gz ../../../../charts/azuremonitor-containers/ pushChartToAcr.sh

14 changes: 14 additions & 0 deletions .pipelines/get-aad-app-creds-from-kv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ do
KV) KV=$VALUE ;;
KVSECRETNAMEAPPID) AppId=$VALUE ;;
KVSECRETNAMEAPPSECRET) AppSecret=$VALUE ;;
KVSECRETNAMECDPXAPPID) CdpxAppId=$VALUE ;;
KVSECRETNAMECDPXAPPSECRET) CdpxAppSecret=$VALUE ;;
*)
esac
done
Expand All @@ -27,4 +29,16 @@ az keyvault secret download --file ~/acrappsecret --vault-name ${KV} --name ${A

echo "downloaded the appsecret from KV:${KV} and KV secret:${AppSecret}"

echo "key vault secret name for cdpx appid:${KVSECRETNAMECDPXAPPID}"

echo "key vault secret name for cdpx appsecret:${KVSECRETNAMECDPXAPPSECRET}"

az keyvault secret download --file ~/cdpxacrappid --vault-name ${KV} --name ${CdpxAppId}

echo "downloaded the appid from KV:${KV} and KV secret:${CdpxAppId}"

az keyvault secret download --file ~/cdpxacrappsecret --vault-name ${KV} --name ${CdpxAppSecret}

echo "downloaded the appsecret from KV:${KV} and KV secret:${CdpxAppSecret}"

echo "end: get app id and secret from specified key vault"
7 changes: 6 additions & 1 deletion .pipelines/pipeline.user.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ restore:

build:
commands:
- !!defaultcommand
- !!buildcommand
name: 'Build Docker Provider Shell Bundle'
command: '.pipelines/build-linux.sh'
fail_on_stderr: false
artifacts:
- from: 'deployment'
to: 'build'
include:
- '**'

package:
commands:
Expand Down
51 changes: 43 additions & 8 deletions .pipelines/pull-from-cdpx-and-push-to-ci-acr-linux-image.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,32 @@ ACR_APP_ID=$(cat ~/acrappid)
ACR_APP_SECRET=$(cat ~/acrappsecret)
echo "end: read appid and appsecret"

echo "start: read appid and appsecret for cdpx"
CDPX_ACR_APP_ID=$(cat ~/cdpxacrappid)
CDPX_ACR_APP_SECRET=$(cat ~/cdpxacrappsecret)
echo "end: read appid and appsecret which has read access on cdpx acr"


# Name of CDPX_ACR should be in this format :Naming convention: 'cdpx' + service tree id without '-' + two digit suffix like'00'/'01
# suffix 00 primary and 01 secondary, and we only use primary
# This configured via pipeline variable
echo "login to cdpxlinux acr:${CDPX_ACR}"
docker login $CDPX_ACR --username $ACR_APP_ID --password $ACR_APP_SECRET
echo "login to cdpxlinux acr completed: ${CDPX_ACR}"
echo $CDPX_ACR_APP_SECRET | docker login $CDPX_ACR --username $CDPX_ACR_APP_ID --password-stdin
if [ $? -eq 0 ]; then
echo "login to cdpxlinux acr: ${CDPX_ACR} completed successfully."
else
echo "-e error login to cdpxlinux acr: ${CDPX_ACR} failed.Please see release task logs."
exit 1
fi

echo "pull agent image from cdpxlinux acr: ${CDPX_ACR}"
docker pull ${CDPX_ACR}/artifact/3170cdd2-19f0-4027-912b-1027311691a2/official/${CDPX_REPO_NAME}:${CDPX_AGENT_IMAGE_TAG}
echo "pull image from cdpxlinux acr completed: ${CDPX_ACR}"
docker pull ${CDPX_ACR}/official/${CDPX_REPO_NAME}:${CDPX_AGENT_IMAGE_TAG}
if [ $? -eq 0 ]; then
echo "pulling of agent image from cdpxlinux acr: ${CDPX_ACR} completed successfully."
else
echo "-e error pulling of agent image from cdpxlinux acr: ${CDPX_ACR} failed.Please see release task logs."
exit 1
fi

echo "CI Release name is:"$CI_RELEASE
imagetag=$CI_RELEASE$CI_IMAGE_TAG_SUFFIX
Expand All @@ -41,14 +60,30 @@ echo "CI ACR : ${CI_ACR}"
echo "CI AGENT REPOSITORY NAME : ${CI_AGENT_REPO}"

echo "tag linux agent image"
docker tag ${CDPX_ACR}/artifact/3170cdd2-19f0-4027-912b-1027311691a2/official/${CDPX_REPO_NAME}:${CDPX_AGENT_IMAGE_TAG} ${CI_ACR}/public/azuremonitor/containerinsights/${CI_AGENT_REPO}:${imagetag}
docker tag ${CDPX_ACR}/official/${CDPX_REPO_NAME}:${CDPX_AGENT_IMAGE_TAG} ${CI_ACR}/public/azuremonitor/containerinsights/${CI_AGENT_REPO}:${imagetag}
if [ $? -eq 0 ]; then
echo "tagging of linux agent image completed successfully."
else
echo "-e error tagging of linux agent image failed. Please see release task logs."
exit 1
fi

echo "login ciprod acr":$CI_ACR
docker login $CI_ACR --username $ACR_APP_ID --password $ACR_APP_SECRET
echo "login to ${CI_ACR} acr completed"
echo $ACR_APP_SECRET | docker login $CI_ACR --username $ACR_APP_ID --password-stdin
if [ $? -eq 0 ]; then
echo "login to ciprod acr: ${CI_ACR} completed successfully"
else
echo "-e error login to ciprod acr: ${CI_ACR} failed. Please see release task logs."
exit 1
fi

echo "pushing the image to ciprod acr:${CI_ACR}"
docker push ${CI_ACR}/public/azuremonitor/containerinsights/${CI_AGENT_REPO}:${imagetag}
echo "pushing the image to ciprod acr completed"
if [ $? -eq 0 ]; then
echo "pushing of the image to ciprod acr completed successfully"
else
echo "-e error pushing of image to ciprod acr failed. Please see release task logs."
exit 1
fi

echo "end: pull linux agent image from cdpx and push to ciprod acr"
51 changes: 43 additions & 8 deletions .pipelines/pull-from-cdpx-and-push-to-ci-acr-windows-image.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,31 @@ ACR_APP_ID=$(cat ~/acrappid )
ACR_APP_SECRET=$(cat ~/acrappsecret)
echo "end: read appid and appsecret"

echo "start: read appid and appsecret for cdpx"
CDPX_ACR_APP_ID=$(cat ~/cdpxacrappid)
CDPX_ACR_APP_SECRET=$(cat ~/cdpxacrappsecret)
echo "end: read appid and appsecret which has read access on cdpx acr"

# Name of CDPX_ACR should be in this format :Naming convention: 'cdpx' + service tree id without '-' + two digit suffix like'00'/'01
# suffix 00 primary and 01 secondary, and we only use primary
# This configured via pipeline variable
echo "login to cdpxwindows acr:${CDPX_ACR}"
docker login $CDPX_ACR --username $ACR_APP_ID --password $ACR_APP_SECRET
echo "login to cdpxwindows acr:${CDPX_ACR} completed"
echo $CDPX_ACR_APP_SECRET | docker login $CDPX_ACR --username $CDPX_ACR_APP_ID --password-stdin
if [ $? -eq 0 ]; then
echo "login to cdpxwindows acr: ${CDPX_ACR} completed successfully."
else
echo "-e error login to cdpxwindows acr: ${CDPX_ACR} failed.Please see release task logs."
exit 1
fi

echo "pull image from cdpxwin acr: ${CDPX_ACR}"
docker pull ${CDPX_ACR}/artifact/3170cdd2-19f0-4027-912b-1027311691a2/official/${CDPX_REPO_NAME}:${CDPX_AGENT_IMAGE_TAG}
echo "pull image from cdpxwin acr completed: ${CDPX_ACR}"
docker pull ${CDPX_ACR}/official/${CDPX_REPO_NAME}:${CDPX_AGENT_IMAGE_TAG}
if [ $? -eq 0 ]; then
echo "pulling of image from cdpxwin acr: ${CDPX_ACR} completed successfully."
else
echo "pulling of image from cdpxwin acr: ${CDPX_ACR} failed. Please see release task logs."
exit 1
fi

echo "CI Release name:"$CI_RELEASE
echo "CI Image Tax suffix:"$CI_IMAGE_TAG_SUFFIX
Expand All @@ -40,14 +58,31 @@ imagetag="win-"$CI_RELEASE$CI_IMAGE_TAG_SUFFIX
echo "agentimagetag="$imagetag

echo "tag windows agent image"
docker tag ${CDPX_ACR}/artifact/3170cdd2-19f0-4027-912b-1027311691a2/official/${CDPX_REPO_NAME}:${CDPX_AGENT_IMAGE_TAG} ${CI_ACR}/public/azuremonitor/containerinsights/${CI_AGENT_REPO}:${imagetag}
docker tag ${CDPX_ACR}/official/${CDPX_REPO_NAME}:${CDPX_AGENT_IMAGE_TAG} ${CI_ACR}/public/azuremonitor/containerinsights/${CI_AGENT_REPO}:${imagetag}
if [ $? -eq 0 ]; then
echo "tagging of windows agent image completed successfully."
else
echo "-e error tagging of windows agent image failed. Please see release task logs."
exit 1
fi

echo "login to ${CI_ACR} acr"
docker login $CI_ACR --username $ACR_APP_ID --password $ACR_APP_SECRET
echo "login to ${CI_ACR} acr completed"
echo $ACR_APP_SECRET | docker login $CI_ACR --username $ACR_APP_ID --password-stdin
if [ $? -eq 0 ]; then
echo "login to acr: ${CI_ACR} completed successfully."
else
echo "login to acr: ${CI_ACR} failed. Please see release task logs."
exit 1
fi


echo "pushing the image to ciprod acr"
docker push ${CI_ACR}/public/azuremonitor/containerinsights/${CI_AGENT_REPO}:${imagetag}
echo "pushing the image to ciprod acr completed"
if [ $? -eq 0 ]; then
echo "pushing the image to ciprod acr completed successfully."
else
echo "pushing the image to ciprod acr failed. Please see release task logs"
exit 1
fi

echo "end: pull windows agent image from cdpx and push to ciprod acr"
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
# push the helm chart as an OCI artifact to specified ACR
# working directory of this script should be charts/azuremonitor-containers

export REPO_PATH="batch1/test/azure-monitor-containers"
# note: this repo registered in arc k8s extension for canary region
export REPO_PATH="public/azuremonitor/containerinsights/canary/preview/azuremonitor-containers"

export HELM_EXPERIMENTAL_OCI=1

for ARGUMENT in "$@"
Expand All @@ -11,32 +12,33 @@ do
VALUE=$(echo $ARGUMENT | cut -f2 -d=)

case "$KEY" in
CIARCACR) CIARCACR=$VALUE ;;
CIACR) CIACR=$VALUE ;;
CICHARTVERSION) CHARTVERSION=$VALUE ;;
*)
esac
done

echo "CI ARC K8S ACR: ${CIARCACR}"
echo "CI ARC K8S ACR: ${CIACR}"
echo "CI HELM CHART VERSION: ${CHARTVERSION}"

echo "start: read appid and appsecret"
ACR_APP_ID=$(cat ~/acrappid)
ACR_APP_SECRET=$(cat ~/acrappsecret)
echo "end: read appid and appsecret"

ACR=${CIARCACR}
ACR=${CIACR}

echo "login to acr:${ACR} using helm"
helm registry login $ACR --username $ACR_APP_ID --password $ACR_APP_SECRET

echo "login to acr:${ACR} using oras"
oras login $ACR --username $ACR_APP_ID --password $ACR_APP_SECRET
echo "login to acr:${ACR} completed: ${ACR}"

echo "start: push the chart version: ${CHARTVERSION} to acr repo: ${ACR}"

echo "generate helm package"
helm package .
echo "save the chart locally with acr full path"
helm chart save . ${ACR}/${REPO_PATH}:${CHARTVERSION}

echo "pushing the helm chart as an OCI artifact"
oras push ${ACR}/${REPO_PATH}:${CHARTVERSION} --manifest-config /dev/null:application/vnd.unknown.config.v1+json ./azuremonitor-containers-${CHARTVERSION}.tgz:application/tar+gzip
echo "pushing the helm chart to ACR: ${ACR}"
helm chart push ${ACR}/${REPO_PATH}:${CHARTVERSION}

echo "end: push the chart version: ${CHARTVERSION} to acr repo: ${ACR}"
53 changes: 53 additions & 0 deletions .pipelines/push-helm-chart-to-prod-repos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash
# working directory of this script should be charts/azuremonitor-containers

# this repo used without extension public preview release
export PROD_REPO_PATH="public/azuremonitor/containerinsights/preview/azuremonitor-containers"

# note: this repo registered in arc k8s extension for prod group1 regions.
export EXTENSION_PROD_REPO_PATH="public/azuremonitor/containerinsights/prod1/preview/azuremonitor-containers"

export HELM_EXPERIMENTAL_OCI=1

for ARGUMENT in "$@"
do
KEY=$(echo $ARGUMENT | cut -f1 -d=)
VALUE=$(echo $ARGUMENT | cut -f2 -d=)

case "$KEY" in
CIACR) CIACR=$VALUE ;;
CICHARTVERSION) CHARTVERSION=$VALUE ;;
*)
esac
done

echo "CI ARC K8S ACR: ${CIACR}"
echo "CI HELM CHART VERSION: ${CHARTVERSION}"

echo "start: read appid and appsecret"
ACR_APP_ID=$(cat ~/acrappid)
ACR_APP_SECRET=$(cat ~/acrappsecret)
echo "end: read appid and appsecret"

ACR=${CIACR}

echo "login to acr:${ACR} using helm"
helm registry login $ACR --username $ACR_APP_ID --password $ACR_APP_SECRET

echo "login to acr:${ACR} completed: ${ACR}"

echo "start: push the chart version: ${CHARTVERSION} to acr repo: ${ACR}"

echo "save the chart locally with acr full path: ${ACR}/${EXTENSION_PROD_REPO_PATH}:${CHARTVERSION}"
helm chart save . ${ACR}/${EXTENSION_PROD_REPO_PATH}:${CHARTVERSION}

echo "save the chart locally with acr full path: ${ACR}/${PROD_REPO_PATH}:${CHARTVERSION}"
helm chart save . ${ACR}/${PROD_REPO_PATH}:${CHARTVERSION}

echo "pushing the helm chart to ACR: ${ACR}/${EXTENSION_PROD_REPO_PATH}:${CHARTVERSION}"
helm chart push ${ACR}/${EXTENSION_PROD_REPO_PATH}:${CHARTVERSION}

echo "pushing the helm chart to ACR: ${ACR}/${PROD_REPO_PATH}:${CHARTVERSION}"
helm chart push ${ACR}/${PROD_REPO_PATH}:${CHARTVERSION}

echo "end: push the chart version: ${CHARTVERSION} to acr repo: ${ACR}"
35 changes: 35 additions & 0 deletions .pipelines/update-place-holdres-in-e2e-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

echo "start: update placeholders of e2e-tests.yaml ..."

for ARGUMENT in "$@"
do
KEY=$(echo $ARGUMENT | cut -f1 -d=)
VALUE=$(echo $ARGUMENT | cut -f2 -d=)

case "$KEY" in
TENANT_ID) TENANT_ID=$VALUE ;;
*)
esac
done

echo "start: read appid and appsecret"
# used the same SP which used for acr
CLIENT_ID=$(cat ~/acrappid)
CLIENT_SECRET=$(cat ~/acrappsecret)
echo "end: read appid and appsecret"

echo "Service Principal CLIENT_ID:$CLIENT_ID"
echo "replace CLIENT_ID value"
sed -i "s=SP_CLIENT_ID_VALUE=$CLIENT_ID=g" e2e-tests.yaml

# only uncomment for debug purpose
# echo "Service Principal CLIENT_SECRET:$CLIENT_SECRET"
echo "replace CLIENT_SECRET value"
sed -i "s=SP_CLIENT_SECRET_VALUE=$CLIENT_SECRET=g" e2e-tests.yaml

echo "Service Principal TENANT_ID:$TENANT_ID"
echo "replace TENANT_ID value"
sed -i "s=SP_TENANT_ID_VALUE=$TENANT_ID=g" e2e-tests.yaml

echo "end: update placeholders of e2e-tests.yaml."
Loading