Skip to content

Commit

Permalink
update all template scripts to check port status
Browse files Browse the repository at this point in the history
  • Loading branch information
DininduSenanayake committed Jul 1, 2024
1 parent f3840fc commit 56b7d23
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion submit.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ script:
native:
container:
name: "codeserver"
image: "ghcr.io/nesi/training-environment-codeserver-app:v0.1.5"
image: "ghcr.io/nesi/training-environment-codeserver-app:v0.1.6"
command: ["/bin/bash","-l","<%= staged_root %>/job_script_content.sh"]
restart_policy: 'OnFailure'
env:
Expand Down
8 changes: 4 additions & 4 deletions template/before.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ exec &> >(tee -a "pod.log")
# Export the module function if it exists
[[ $(type -t module) == "function" ]] && export -f module

# Find available port to run server on
export port=$(find_port ${host})
export host="$HOST_CFG"
export port="$PORT_CFG"

# Export compute node the script is running on
export host="${host}"
echo "host is: ${host}"
echo "port is: ${port}"

# Generate SHA1 encrypted password (requires OpenSSL installed)
export password="$(create_passwd 16)"
4 changes: 2 additions & 2 deletions template/script.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mkdir -p "$CODE_SERVER_DATAROOT/extensions"
export PASSWORD="$password"

# Print compute node.
echo "$(date): Running on compute node ${compute_node}:$port"
echo "$(date): Running on compute node ${host}:$port"


#Probably not needed but leaving as it is for the moment as per upstream record.
Expand Down Expand Up @@ -47,7 +47,7 @@ echo ""

code-server \
--auth="password" \
--bind-addr="0.0.0.0:8443" \
--bind-addr="${host}:8443" \
--disable-telemetry \
--user-data-dir="${CODE_SERVER_DATAROOT}" \
--log debug

0 comments on commit 56b7d23

Please sign in to comment.