Skip to content

Commit

Permalink
Automate container running
Browse files Browse the repository at this point in the history
Run automateRPDeploy.sh script inside the container & fix hive installation script
  • Loading branch information
razo7 committed Aug 12, 2024
1 parent aa181d0 commit ac0370b
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ steps:
set -e
# export the SECRET_SA_ACCOUNT_NAME environment variable and run make secrets
# az account set -s fe16a035-e540-4ab7-80d9-373fa9a3d6ae
az account list -o table
az account list -o table
az account show
export SECRET_SA_ACCOUNT_NAME=${{ parameters.secretSA }} && make secrets
Expand All @@ -34,7 +34,7 @@ steps:
[ -z "${{ parameters.location }}" ] && export LOCATION=eastus || export LOCATION="${{ parameters.location }}"
# Source environment variables from the secrets file
source secrets/env
export AZURE_PREFIX=${{ parameters.azurePrefix }} NO_CACHE=${{ variables.NO_CACHE }} ARO_INSTALL_VIA_HIVE=${{ variables.ARO_INSTALL_VIA_HIVE }}
export ARO_ADOPT_BY_HIVE=${{ variables.ARO_ADOPT_BY_HIVE }} DATABASE_NAME=${{ variables.DATABASE_NAME }}
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,11 @@ rp-full-dev: # Build and run a rp-full-dev container for automating rp-full-dev
--build-arg ARO_RP_BRANCH=$(ARO_RP_BRANCH) \
-f Dockerfile.rp-full-dev \
-t $(RP_FULL_DEV_IMAGE) .
docker run --rm -it --user=0 --privileged -v /dev/shm:/dev/shm -v "${HOME}/.azure:/root/.azure" --device /dev/net/tun --name rp-full-dev-container $(RP_FULL_DEV_IMAGE)
docker run --rm -it --user=0 --privileged \
-v /dev/shm:/dev/shm \
-v "${HOME}/.azure:/root/.azure" \
--device /dev/net/tun \
--name rp-full-dev-container $(RP_FULL_DEV_IMAGE)

.PHONY: rp-full-dev-clenup
rp-full-dev-clenup: # Clean all the rp-full-dev resources by deleting ResourceGroups and KeyVaults
Expand Down
3 changes: 1 addition & 2 deletions hack/devtools/rp-dev-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ extract_image_tag() {
fi
done


local return_line=$(grep -A 1 "func $1" "$2" | grep 'return')
local return_line=$(grep -A 2 "func $1" "$2" | grep 'return')
echo "$return_line" | sed 's/.*"\(.*\)@sha256.*/\1/'
}

Expand Down
2 changes: 0 additions & 2 deletions hack/hive-dev-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,5 @@ $KUBECTL apply -f ./hack/hive-config/hive-additional-install-log-regexes.yaml
$KUBECTL apply -f ./hack/hive-config/hive-deployment.yaml

$KUBECTL wait --timeout=5m --for=condition=Available --namespace $HIVE_OPERATOR_NS deployment/hive-operator
$KUBECTL wait --timeout=5m --for=condition=Available --namespace $HIVE_OPERATOR_NS deployment/hive-controllers
$KUBECTL wait --timeout=5m --for=condition=Ready --namespace $HIVE_OPERATOR_NS pod --selector "control-plane=clustersync"

echo -e "\nHive is installed."
9 changes: 9 additions & 0 deletions hack/rp-dev/automateRPDeploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -e

echo "##### Make sure to be logining in to Azure prior to running this script ####"
source hack/rp-dev/setupRPConfig.sh $AZURE_PREFIX # setup config file
make pre-deploy-no-aks # deploy predeployment resources prior to AKS
echo "Success step 3 ✅ - deploy pre-deployment resources prior to AKS"
./hack/rp-dev/preRPDeploy.sh
make go-verify deploy
echo "Success step 8 ✅ - fully deploy all the resources for ARO RP and GWY VMSSs"
2 changes: 1 addition & 1 deletion hack/rp-dev/preRPDeploy.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ echo "Success step 6e ✈️ 📦 - Copy Fluenbit image to ACR"
echo "Success step 6 ✅ - Mirror repos to ACR"

export PARENT_DOMAIN_NAME=osadev.cloud
export PARENT_DOMAIN_RESOURCEGROUP=dns
# export PARENT_DOMAIN_RESOURCEGROUP=dns
export GLOBAL_RESOURCEGROUP=${AZURE_PREFIX}-global

for DOMAIN_NAME in ${AZURE_PREFIX}-clusters.$PARENT_DOMAIN_NAME ${AZURE_PREFIX}-rp.$PARENT_DOMAIN_NAME; do
Expand Down
2 changes: 1 addition & 1 deletion pkg/deploy/generator/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ const (
retryLaterTriggerFunction = "function trigger() {\n\t\t\t\tvar request = getContext().getRequest();\n\t\t\t\tvar body = request.getBody();\n\t\t\t\tvar date = new Date();\n\t\t\t\tbody[\"leaseExpires\"] = Math.floor(date.getTime() / 1000) + 600;\n\t\t\t\trequest.setBody(body);\n\t\t\t}"
setCreationBillingTimeStampTriggerFunction = "function trigger() {\n\t\t\t\tvar request = getContext().getRequest();\n\t\t\t\tvar body = request.getBody();\n\t\t\t\tvar date = new Date();\n\t\t\t\tvar now = Math.floor(date.getTime() / 1000);\n\t\t\t\tvar billingBody = body[\"billing\"];\n\t\t\t\tif (!billingBody[\"creationTime\"]) {\n\t\t\t\t\tbillingBody[\"creationTime\"] = now;\n\t\t\t\t}\n\t\t\t\trequest.setBody(body);\n\t\t\t}"
setDeletionBillingTimeStampTriggerFunction = "function trigger() {\n\t\t\t\tvar request = getContext().getRequest();\n\t\t\t\tvar body = request.getBody();\n\t\t\t\tvar date = new Date();\n\t\t\t\tvar now = Math.floor(date.getTime() / 1000);\n\t\t\t\tvar billingBody = body[\"billing\"];\n\t\t\t\tif (!billingBody[\"creationTime\"]) {\n\t\t\t\t\tbillingBody[\"creationTime\"] = now;\n\t\t\t\t}\n\t\t\t\trequest.setBody(body);\n\t\t\t}"
)
)
2 changes: 1 addition & 1 deletion pkg/deploy/generator/templates_rp.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func (g *generator) rpPredeployTemplate(hasAKS bool) *arm.Template {
g.rpPortalKeyvault(),
g.rpServiceKeyvault(),
)

if hasAKS {
t.Resources = append(t.Resources, g.rpServiceKeyvaultDynamic())
}
Expand Down
6 changes: 1 addition & 5 deletions pkg/deploy/predeploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,6 @@ func (d *deployer) deployPreDeploy(ctx context.Context, resourceGroupName, deplo
}

parameters := d.getParameters(template["parameters"].(map[string]interface{}))
// if !isCreate {
// parameters.Parameters["deployNSGs"] = &arm.ParametersParameter{
// Value: isCreate,
// }
parameters.Parameters["deployNSGs"] = &arm.ParametersParameter{
Value: isCreate,
}
Expand Down Expand Up @@ -565,4 +561,4 @@ func (d *deployer) isVMInstanceHealthy(ctx context.Context, resourceGroupName st
return false
}
return true
}
}
2 changes: 1 addition & 1 deletion pkg/util/version/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var DefaultInstallStream = Stream{
// FluentbitImage contains the location of the Fluentbit container image
func FluentbitImage(acrDomain string) string {
// https://github.com/microsoft/azurelinux/releases
return acrDomain + "/fluentbit:1.9.10-cm20240628@sha256:1d0b1789f4eb06f5c74fa5def306bd5095852882f63d91578ef589e8eab18765"
return acrDomain + "/fluentbit:1.9.10-cm20240628@sha256:dbf5304bd98cd51c72e4ae0ee8511d3bbcdbcb7e72e65e7d1495a50d7ac33b8d"
}

// MdmImage contains the location of the MDM container image
Expand Down

0 comments on commit ac0370b

Please sign in to comment.