This repository was archived by the owner on Jun 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontainer-start.bash
More file actions
48 lines (44 loc) · 1.46 KB
/
Copy pathcontainer-start.bash
File metadata and controls
48 lines (44 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# gsutil cp container-start.bash gs://tms-storage-1/Container/container-start.bash
function init {
# Using cloudsql in the background
cloud_sql_proxy -instances=tmssword:asia-northeast1:tmssql -dir=/cloudsql -ip_address_types=PRIVATE &
}
function copy {
GSUTIL_OPTS="-m -q
-o 'GSUtil:parallel_thread_count=8'
-o 'GSUtil:sliced_object_download_max_components=32'"
echo "bucket -> ${IMAGENAME}"
gsutil ${GSUTIL_OPTS} \
rsync -r -x ".*\.sav$|.*\.log.*|plugins/.*\.json$|.*stats/|
.*advancements/|.*userdata/|.*\.csv$|.*[pP]layer[dD]ata/" \
"gs://${BUCKET_URI}" "." || exit
}
function chowning {
if [ $UID == 0 ]; then
chown -R ${IMAGENAME}:${IMAGENAME} /${IMAGENAME}
fi
}
function end {
echo "Set the initial memory to ${INIT_BUNGEE_MEM:-${JAR_MEM}} and the maximum memory to ${MAX_BUNGEE_MEM:-${JAR_MEM}}"
JVM_OPTS="-Xms${INIT_JAR_MEM:-${JAR_MEM}} -Xmx${MAX_JAR_MEM:-${JAR_MEM}}"
JVM_OPT2="-XX:+UnlockExperimentalVMOptions
-XX:MaxGCPauseMillis=100
-XX:+DisableExplicitGC
-XX:TargetSurvivorRatio=90
-XX:G1NewSizePercent=50
-XX:G1MaxNewSizePercent=80
-XX:G1MixedGCLiveThresholdPercent=35
-XX:+AlwaysPreTouch
-XX:+ParallelRefProcEnabled
-XX:+UseLargePagesInMetaspace"
if [ $UID == 0 ]; then
exec sudo -u ${IMAGENAME} java $JVM_OPTS $JVM_OPT2 -jar $BOOTJAR
else
exec java $JVM_OPTS $JVM_OPT2 -jar
fi
}
init
copy
chowning
end