automated terminal push
All checks were successful
code.softwareshinobi.com - yankee/yankee-downloader-desktop/pipeline/head This commit looks good
All checks were successful
code.softwareshinobi.com - yankee/yankee-downloader-desktop/pipeline/head This commit looks good
This commit is contained in:
94
compose.bash
94
compose.bash
@@ -2,108 +2,18 @@
|
|||||||
|
|
||||||
##
|
##
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
##
|
|
||||||
|
|
||||||
reset
|
reset
|
||||||
|
|
||||||
clear
|
clear
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
##
|
set -x
|
||||||
|
|
||||||
processorCount=`grep -c '^processor' /proc/cpuinfo`
|
|
||||||
|
|
||||||
processorCount=$((processorCount - 1))
|
|
||||||
|
|
||||||
echo "num cpus / "$processorCount
|
|
||||||
|
|
||||||
for i in $(seq 2 "$processorCount"); do
|
|
||||||
|
|
||||||
echo "Processing unit: $i"
|
|
||||||
|
|
||||||
##
|
|
||||||
|
|
||||||
rm -f compose.yaml
|
|
||||||
|
|
||||||
echo "services:" >> compose.yaml
|
|
||||||
|
|
||||||
##
|
|
||||||
|
|
||||||
for x in $(seq 1 "$processorCount"); do
|
|
||||||
|
|
||||||
i=$(printf "%03d" "$x")
|
|
||||||
|
|
||||||
# Create the service definition
|
|
||||||
service_def=$(cat <<EOF
|
|
||||||
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
##
|
|
||||||
## orchestration / yankee-desktop-remix
|
|
||||||
##
|
|
||||||
##########################################$i
|
|
||||||
|
|
||||||
yankee-desktop-remix-$i:
|
|
||||||
container_name: yankee-desktop-remix-$i
|
|
||||||
image: softwareshinobi/yankee-desktop-remix
|
|
||||||
restart: unless-stopped
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
volumes:
|
|
||||||
- yankee-nfs-downloads:/root/Downloads
|
|
||||||
hostname: yankee-desktop-$i
|
|
||||||
ports:
|
|
||||||
- "2${i}2:22"
|
|
||||||
- "2${i}8:80"
|
|
||||||
- "2${i}9:5900"
|
|
||||||
environment:
|
|
||||||
TZ: America/Bogota
|
|
||||||
USER_UID: 1000
|
|
||||||
USER_GID: 1000
|
|
||||||
USER: root
|
|
||||||
PASSWORD: yankee
|
|
||||||
HTTP_PASSWORD: yankee
|
|
||||||
|
|
||||||
EOF
|
|
||||||
)
|
|
||||||
|
|
||||||
# Append the service definition to compose.yaml
|
|
||||||
echo "$service_def" >> compose.yaml
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
# Add the volumes section ONCE after the loop (outside)
|
|
||||||
cat <<EOF >> compose.yaml
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
##
|
|
||||||
## volumes / yankee-desktop-remix
|
|
||||||
##
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
yankee-nfs-downloads:
|
|
||||||
driver_opts:
|
|
||||||
type: "nfs"
|
|
||||||
o: nfsvers=4,addr=osiris.yankee.embanet.online,nolock,hard,rw
|
|
||||||
device: ":/"
|
|
||||||
|
|
||||||
EOF
|
|
||||||
#... your commands to process each unit...
|
|
||||||
|
|
||||||
done
|
|
||||||
##
|
##
|
||||||
|
|
||||||
docker compose down --remove-orphans
|
docker compose down --remove-orphans
|
||||||
|
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
|
||||||
docker stats
|
|
||||||
|
|||||||
109
composeX.bash
Executable file
109
composeX.bash
Executable file
@@ -0,0 +1,109 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
reset
|
||||||
|
|
||||||
|
clear
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
processorCount=`grep -c '^processor' /proc/cpuinfo`
|
||||||
|
|
||||||
|
processorCount=$((processorCount - 1))
|
||||||
|
|
||||||
|
echo "num cpus / "$processorCount
|
||||||
|
|
||||||
|
for i in $(seq 2 "$processorCount"); do
|
||||||
|
|
||||||
|
echo "Processing unit: $i"
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
rm -f compose.yaml
|
||||||
|
|
||||||
|
echo "services:" >> compose.yaml
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
for x in $(seq 1 "$processorCount"); do
|
||||||
|
|
||||||
|
i=$(printf "%03d" "$x")
|
||||||
|
|
||||||
|
# Create the service definition
|
||||||
|
service_def=$(cat <<EOF
|
||||||
|
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
##
|
||||||
|
## orchestration / yankee-desktop-remix
|
||||||
|
##
|
||||||
|
##########################################$i
|
||||||
|
|
||||||
|
yankee-desktop-remix-$i:
|
||||||
|
container_name: yankee-desktop-remix-$i
|
||||||
|
image: softwareshinobi/yankee-desktop-remix
|
||||||
|
restart: unless-stopped
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
volumes:
|
||||||
|
- yankee-nfs-downloads:/root/Downloads
|
||||||
|
hostname: yankee-desktop-$i
|
||||||
|
ports:
|
||||||
|
- "2${i}2:22"
|
||||||
|
- "2${i}8:80"
|
||||||
|
- "2${i}9:5900"
|
||||||
|
environment:
|
||||||
|
TZ: America/Bogota
|
||||||
|
USER_UID: 1000
|
||||||
|
USER_GID: 1000
|
||||||
|
USER: root
|
||||||
|
PASSWORD: yankee
|
||||||
|
HTTP_PASSWORD: yankee
|
||||||
|
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
# Append the service definition to compose.yaml
|
||||||
|
echo "$service_def" >> compose.yaml
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
# Add the volumes section ONCE after the loop (outside)
|
||||||
|
cat <<EOF >> compose.yaml
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
##
|
||||||
|
## volumes / yankee-desktop-remix
|
||||||
|
##
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
yankee-nfs-downloads:
|
||||||
|
driver_opts:
|
||||||
|
type: "nfs"
|
||||||
|
o: nfsvers=4,addr=osiris.yankee.embanet.online,nolock,hard,rw
|
||||||
|
device: ":/"
|
||||||
|
|
||||||
|
EOF
|
||||||
|
#... your commands to process each unit...
|
||||||
|
|
||||||
|
done
|
||||||
|
##
|
||||||
|
|
||||||
|
docker compose down --remove-orphans
|
||||||
|
|
||||||
|
docker compose up -d
|
||||||
|
|
||||||
|
docker stats
|
||||||
Reference in New Issue
Block a user