Added sumo-mac
This commit is contained in:
1 parent
d83255dc91
commit
c8aaf743b9
21 files changed
+286
-1
No files matched your search
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
dep=${1}
|
||||
eks $dep analytics-airflow ${@:2}
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
dep=${1}
|
||||
eks $dep analytics-airflow-v2 ${@:2}
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
current_dep=$(kubectl config current-context | cut -d '-' -f2)
|
||||
airflow-v2 ${1:-$current_dep} get pod --sort-by=.status.startTime -l task_id
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
current_dep=$(kubectl config current-context | cut -d '-' -f2)
|
||||
dep=${1:-$current_dep}
|
||||
airflow-v2 $dep rollout restart deploy/$dep-analytics-airflow-v2-web &
|
||||
airflow-v2 $dep rollout restart deploy/$dep-analytics-airflow-v2-scheduler &
|
||||
wait
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
dep=${1}
|
||||
eks $dep analytics ${@:2}
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
dep=${1}
|
||||
eks $dep csi ${@:2}
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
dev hcvault login
|
||||
eval $(dev hcvault cli_env -a infrastructure)
|
||||
|
||||
region="us-west-2"
|
||||
aws_account_id=`aws sts get-caller-identity --query "Account" --output text`
|
||||
|
||||
aws ecr get-login-password --region ${region} | docker login --username AWS --password-stdin ${aws_account_id}.dkr.ecr.${region}.amazonaws.com
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
dep=${1}
|
||||
assembly=${2}
|
||||
echo "${dep}/${assembly}"
|
||||
kubectl --cluster eks-$dep -n $dep-${assembly} --context eks-$dep-eks-$dep ${@:3}
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
current_dep=$(kubectl config current-context | cut -d "-" -f2)
|
||||
dep=${2:-$current_dep}
|
||||
echo "$dep $current_dep"
|
||||
kubectl config set-context --current --namespace=$dep-${1}
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
|
||||
# pod=analytics-84d4bff6c-2fzj9
|
||||
namespace=us2-analytics
|
||||
|
||||
echo "getting pods..."
|
||||
pods=`kubectl get pods -n $namespace`
|
||||
totalpods=$(echo $pods | wc -l)
|
||||
totalpods="$((totalpods-1))"
|
||||
echo $pods | awk "NR==1" | awk '$0=" "$0'
|
||||
echo $pods | awk "NR>1" | awk '$0=NR") "$0'
|
||||
echo "> Please select one of the pods, enter a number between 1 and $totalpods"
|
||||
read pod_num
|
||||
|
||||
case ${pod_num#[-+]} in
|
||||
*[!0-9]* | '') echo "Must be an integer." ;;
|
||||
esac
|
||||
|
||||
pod=$(kubectl get pods -n $namespace | awk {'print $1}' | awk -v pod_num=$pod_num 'NR==pod_num+1')
|
||||
echo "Getting memory dump for $pod - Continue? [ANY KEY]..."
|
||||
read
|
||||
kubectl exec -n $namespace $pod -c analytics-assembly -- jcmd Bootstrap GC.heap_dump /tmp/$pod.hprof
|
||||
kubectl exec -n $namespace $pod -c analytics-assembly -- gzip /tmp/$pod.hprof
|
||||
kubectl -n $namespace cp -c analytics-assembly $pod:/tmp/$pod.hprof.gz $pod.hprof.gz
|
||||
|
||||
kubectl exec -n $namespace $pod -c analytics-assembly -it -- /bin/bash
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
name=${1:-new}
|
||||
dep=${2:-stag}
|
||||
|
||||
cmd="helm template --values test_values.yaml --values values.yaml --values values-$dep.yaml"
|
||||
|
||||
if [ ! -z "values-$dep.auto.yaml"]; then
|
||||
cmd="$cmd --values values-$dep.auto.yaml"
|
||||
fi
|
||||
|
||||
cmd="$cmd --debug . > tmp/$name.yml"
|
||||
echo $cmd
|
||||
|
||||
$cmd
|
||||
|
||||
if [ $name == "new" ];
|
||||
|
||||
if [ ! -z "tmp/old.yml" ]; then
|
||||
diff tmp/original.yml tmp/new.yml > tmp/diff
|
||||
fi
|
||||
|
||||
fi
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
TF_LOG=trace terraform apply --auto-approve &> apply.log
|
||||
TF_LOG=trace terraform destroy --auto-approve &> destroy.log
|
||||
|
||||
cat destroy.log | grep "DEBUG: Request" | sed -nr 's/^.*Request (.*) Details:/\1/p' | sort | uniq > all.perms
|
||||
cat apply.log | grep "DEBUG: Request" | sed -nr 's/^.*Request (.*) Details:/\1/p' | sort | uniq >> all.perms
|
||||
cat all.perms | sort | uniq -u > required.perms
|
||||
rm all.perms
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#/bin/zsh
|
||||
set -e
|
||||
|
||||
dev encrypted_disk mount
|
||||
dev provision ssh_keys
|
||||
ssh-add /Volumes/Encrypted/keys/prod_rsa
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
dev hcvault login
|
||||
dev hcvault console -o
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
gawk 'match($0,/'$1'/, ary) {print ary['${2:-'1'}']}'
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
eks us2 analytics-sagemaker ${@:1}
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
cred_file=${1}
|
||||
aws_cred_file=$HOME/.aws/credentials
|
||||
|
||||
source $HOME/$cred_file.sh
|
||||
|
||||
if [ -z "${AWS_ACCESS_KEY_ID}" ]; then
|
||||
echo "Missing access key";
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${AWS_SECRET_ACCESS_KEY}" ]; then
|
||||
echo "Missing AWS_SECRET_ACCESS_KEY";
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${AWS_SESSION_TOKEN}" ]; then
|
||||
echo "Missing AWS_SESSION_TOKEN";
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Updating $aws_cred_file ..."
|
||||
echo "[default]" > $aws_cred_file
|
||||
echo "aws_access_key_id = $AWS_ACCESS_KEY_ID" >> $aws_cred_file
|
||||
echo "aws_secret_access_key = $AWS_SECRET_ACCESS_KEY" >> $aws_cred_file
|
||||
echo "aws_session_token=$AWS_SESSION_TOKEN" >> $aws_cred_file
|
||||
|
||||
unset AWS_ACCESS_KEY_ID
|
||||
unset AWS_SECRET_ACCESS_KEY
|
||||
unset AWS_SESSION_TOKEN
|
||||
|
||||
echo `aws sts get-caller-identity`
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "<<< ◉ Updating dsh ⦿ >>>"
|
||||
cd ~/git/sumo && git fetch origin master:master && git merge master && git status
|
||||
|
||||
echo "<<< ◉ Updatig knobs ⦿ >>>"
|
||||
cd ~/git/knobs && git fetch origin master:master && git merge master && git status
|
||||
|
||||
Reference in new issue
Block a user