Skip to content

Commit

Permalink
Merge pull request oracle#297 from galiacheng/wls-autoscaling-0131
Browse files Browse the repository at this point in the history
  • Loading branch information
rjeberhard authored May 11, 2024
2 parents 1ab587c + 005fb8d commit c30f49c
Show file tree
Hide file tree
Showing 32 changed files with 1,169 additions and 112 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/testWlsAksWithDependencyCreation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,14 @@ jobs:
az aks get-credentials --resource-group ${{ env.resourceGroupForWlsAks }} --name $aksClusterName
- name: Generate&Apply configmap
run: |
wlsDomainNS=sample-domain1-ns
wlsConfigmapName=sample-domain1-wdt-config-map
wlsConfigmapJson=cargo-tracker-db.json
modelFilePath=models
mkdir ${modelFilePath}
echo "create configmap"
echo "export exisiting configmap"
kubectl -n sample-domain1-ns get configmap ${wlsConfigmapName} -o json >${wlsConfigmapJson}
kubectl -n ${wlsDomainNS} get configmap ${wlsConfigmapName} -o json >${wlsConfigmapJson}
echo "query model keys"
keyList=$(cat ${wlsConfigmapJson} | jq '.data | keys[]' | tr -d "\"")
Expand All @@ -343,24 +344,25 @@ jobs:
done
# remove current configmap and create a new one
kubectl -n sample-domain1-ns delete configmap ${wlsConfigmapName}
kubectl -n ${wlsDomainNS} delete configmap ${wlsConfigmapName}
cp cargotracker/src/test/aks/cargo-tracker-jms.yaml ${modelFilePath}/cargo-tracker-jms.yaml
kubectl -n sample-domain1-ns create configmap ${wlsConfigmapName} \
kubectl -n ${wlsDomainNS} create configmap ${wlsConfigmapName} \
--from-file=${modelFilePath}
kubectl -n sample-domain1-ns label configmap ${wlsConfigmapName} \
kubectl -n ${wlsDomainNS} label configmap ${wlsConfigmapName} \
weblogic.domainUID=sample-domain1
restartVersion=$(kubectl -n sample-domain1-ns get domain sample-domain1 '-o=jsonpath={.spec.restartVersion}')
restartVersion=$(kubectl -n ${wlsDomainNS} get domain sample-domain1 '-o=jsonpath={.spec.restartVersion}')
# increase restart version
restartVersion=$((restartVersion + 1))
# record timestamp before apply changes
timestampBeforePatchingDomain=$(date +%s)
# get the replica number
replicas=$(kubectl -n sample-domain1-ns get domain sample-domain1 -o json | jq '. | .spec.clusters[] | .replicas')
# get the replica number
clusterName=$(kubectl get cluster -n ${wlsDomainNS} -o json | jq -r '.items[0].metadata.name')
replicas=$(kubectl -n ${wlsDomainNS} get cluster ${clusterName} -o json | jq '. | .spec.replicas')
echo "append configmap and update restart version"
kubectl -n sample-domain1-ns patch domain sample-domain1 \
kubectl -n ${wlsDomainNS} patch domain sample-domain1 \
--type=json \
'-p=[{"op": "replace", "path": "/spec/restartVersion", "value": "'${restartVersion}'" }, {"op": "add", "path": "/spec/configuration/model/configMap", "value": "'${wlsConfigmapName}'" }]'
echo "timestampBeforePatchingDomain=${timestampBeforePatchingDomain}" >> $GITHUB_ENV
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/testWlsAksWithoutDependencyCreation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,14 @@ jobs:
az aks get-credentials --resource-group ${{ needs.preflight.outputs.resourceGroupForWlsAks }} --name $aksClusterName
- name: Generate&Apply configmap
run: |
wlsDomainNS=sample-domain1-ns
wlsConfigmapName=sample-domain1-wdt-config-map
wlsConfigmapJson=cargo-tracker-db.json
modelFilePath=models
mkdir ${modelFilePath}
echo "create configmap"
echo "export exisiting configmap"
kubectl -n sample-domain1-ns get configmap ${wlsConfigmapName} -o json >${wlsConfigmapJson}
kubectl -n ${wlsDomainNS} get configmap ${wlsConfigmapName} -o json >${wlsConfigmapJson}
echo "query model keys"
keyList=$(cat ${wlsConfigmapJson} | jq '.data | keys[]' | tr -d "\"")
Expand All @@ -299,24 +300,25 @@ jobs:
done
# remove current configmap and create a new one
kubectl -n sample-domain1-ns delete configmap ${wlsConfigmapName}
kubectl -n ${wlsDomainNS} delete configmap ${wlsConfigmapName}
cp cargotracker/src/test/aks/cargo-tracker-jms.yaml ${modelFilePath}/cargo-tracker-jms.yaml
kubectl -n sample-domain1-ns create configmap ${wlsConfigmapName} \
kubectl -n ${wlsDomainNS} create configmap ${wlsConfigmapName} \
--from-file=${modelFilePath}
kubectl -n sample-domain1-ns label configmap ${wlsConfigmapName} \
kubectl -n ${wlsDomainNS} label configmap ${wlsConfigmapName} \
weblogic.domainUID=sample-domain1
restartVersion=$(kubectl -n sample-domain1-ns get domain sample-domain1 '-o=jsonpath={.spec.restartVersion}')
restartVersion=$(kubectl -n ${wlsDomainNS} get domain sample-domain1 '-o=jsonpath={.spec.restartVersion}')
# increase restart version
restartVersion=$((restartVersion + 1))
# record timestamp before apply changes
timestampBeforePatchingDomain=$(date +%s)
# get the replica number
replicas=$(kubectl -n sample-domain1-ns get domain sample-domain1 -o json | jq '. | .spec.clusters[] | .replicas')
# get the replica number
clusterName=$(kubectl get cluster -n ${wlsDomainNS} -o json | jq -r '.items[0].metadata.name')
replicas=$(kubectl -n ${wlsDomainNS} get cluster ${clusterName} -o json | jq '. | .spec.replicas')
echo "append configmap and update restart version"
kubectl -n sample-domain1-ns patch domain sample-domain1 \
kubectl -n ${wlsDomainNS} patch domain sample-domain1 \
--type=json \
'-p=[{"op": "replace", "path": "/spec/restartVersion", "value": "'${restartVersion}'" }, {"op": "add", "path": "/spec/configuration/model/configMap", "value": "'${wlsConfigmapName}'" }]'
echo "timestampBeforePatchingDomain=${timestampBeforePatchingDomain}" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<properties>
<!-- versions start -->
<!-- weblogic azure aks versions -->
<version.wls-on-aks-azure-marketplace>1.0.74</version.wls-on-aks-azure-marketplace>
<version.wls-on-aks-azure-marketplace>1.0.75</version.wls-on-aks-azure-marketplace>
<!-- weblogic azure vm versions -->
<version.arm-oraclelinux-wls>1.0.27</version.arm-oraclelinux-wls>
<version.arm-oraclelinux-wls-admin>1.0.50</version.arm-oraclelinux-wls-admin>
Expand Down
2 changes: 2 additions & 0 deletions resources/azure-common.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ azure.apiVersionForTags=2023-07-01
azure.apiVersionForStorage=2023-01-01
# Microsoft.Storage/storageAccounts/fileServices
azure.apiVersionForStorageFileService=2023-01-01
# Microsoft.Monitor/accounts
azure.apiVersionForMonitorAccount=2023-04-03

# AzureAzCLI version
azure.cli.version=2.53.0
Expand Down
Loading

0 comments on commit c30f49c

Please sign in to comment.