Skip to content

Commit

Permalink
Merge pull request #1533 from mapellidario/20240801_crabserver
Browse files Browse the repository at this point in the history
crabserver - update image path, versions
  • Loading branch information
arooshap authored Aug 5, 2024
2 parents 0cb2d75 + da13ef5 commit 6d4ec88
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 7 deletions.
18 changes: 15 additions & 3 deletions helm/crabserver/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
#! /bin/bash
set -euo pipefail
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )


# hash table of clusters nickname-name:
declare -A cluster_map=([prod]=prod)
cluster_map[prod]=k8s-prodsrv
cluster_map[preprod]=k8s-prodsrv-v1.22.9
cluster_map[testbed]=testbed
cluster_map[test2]=test2
cluster_map[test11]=test11
cluster_map[test12]=test12
if [[ $# -ne 1 ]]; then
echo "Usage: deploy.sh ENVNAME"
echo " ENVNAME=(prod|testbed|test2|test11|test12)"
echo " ENVNAME=(prod|preprod|testbed|test2|test11|test12)"
exit 1
fi
desired_cluster=$1
desired_cluster="${cluster_map[$1]}"

# make sure that your current context points to the desired cluster
current_cluster=$(kubectl config view -o json | jq '.["current-context"] as $context | .["contexts"][] | select(.name | contains($context))| .context.cluster')

if [[ $current_cluster =~ $desired_cluster ]]; then
echo "deploying to $desired_cluster";
helm template crabserver . -f values.yaml -f values-$desired_cluster.yaml | kubectl -n crab apply -f -
helm template crabserver . -f values.yaml -f values-${1}-pypi.yaml | kubectl -n crab apply -f -
else
echo "wrong cluster: your are connected to $current_cluster";
fi
Expand Down
18 changes: 18 additions & 0 deletions helm/crabserver/values-preprod-pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
environment: "preprod"

image:
path: registry.cern.ch/cmscrab/crabserver
pullPolicy: IfNotPresent
tag: "v3.240731-stable"
command:
- /data/entrypoint.sh
args:
- /bin/bash
- -c
- |
sudo cp -r /host/etc/grid-security/* /etc/grid-security \
&& echo 'INFO Files in /etc/grid-security' \
&& ls -lahZ /etc/grid-security \
&& /data/run.sh
18 changes: 18 additions & 0 deletions helm/crabserver/values-prod-pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
environment: "prod"

image:
path: registry.cern.ch/cmscrab/crabserver
pullPolicy: IfNotPresent
tag: "v3.240731-stable"
command:
- /data/entrypoint.sh
args:
- /bin/bash
- -c
- |
sudo cp -r /host/etc/grid-security/* /etc/grid-security \
&& echo 'INFO Files in /etc/grid-security' \
&& ls -lahZ /etc/grid-security \
&& /data/run.sh
4 changes: 2 additions & 2 deletions helm/crabserver/values-prod.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
environment: "prod"
environment: "preprod"

image:
tag: "v3.240508"
tag: "v3.240731-stable"

4 changes: 4 additions & 0 deletions helm/crabserver/values-test1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
environment: "test"

image:
tag: "v3.240709"
2 changes: 1 addition & 1 deletion helm/crabserver/values-test11-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ image:
- /bin/bash
- -c
- |
sudo cp /host/etc/grid-security/* /etc/grid-security \
sudo cp -r /host/etc/grid-security/* /etc/grid-security \
&& echo 'INFO Files in /etc/grid-security' \
&& ls -lahZ /etc/grid-security \
&& /data/run.sh
Expand Down
18 changes: 18 additions & 0 deletions helm/crabserver/values-testbed-pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
environment: "testbed"

image:
path: registry.cern.ch/cmscrab/crabserver
pullPolicy: IfNotPresent
tag: "v3.240731-stable"
command:
- /data/entrypoint.sh
args:
- /bin/bash
- -c
- |
sudo cp -r /host/etc/grid-security/* /etc/grid-security \
&& echo 'INFO Files in /etc/grid-security' \
&& ls -lahZ /etc/grid-security \
&& /data/run.sh
2 changes: 1 addition & 1 deletion helm/crabserver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ replicaCount:
test: 1

image:
path: registry.cern.ch/cmsweb/crabserver
path: registry.cern.ch/cmscrab/crabserver
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: "v3.231006"
Expand Down

0 comments on commit 6d4ec88

Please sign in to comment.