Skip to content

Commit

Permalink
another attempt at fixing password issue
Browse files Browse the repository at this point in the history
  • Loading branch information
DininduSenanayake committed Aug 4, 2024
1 parent e3d98f2 commit 77ed174
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.20"
image: "ghcr.io/nesi/training-environment-codeserver-app:v0.1.21"
command: ["/bin/bash","-l","<%= staged_root %>/job_script_content.sh"]
restart_policy: 'OnFailure'
env:
Expand Down
10 changes: 4 additions & 6 deletions template/before.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ exec &> >(tee -a "pod.log")
# Export the module function if it exists
[[ $(type -t module) == "function" ]] && export -f module

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

# 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)
#commenting this out to check whether this is the cause of the $PASSWORD variable not getting invoked correctly
export password="$(create_passwd 16)"
PASSWORD="$password"
export password PASSWORD

2 changes: 2 additions & 0 deletions template/script.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ fi
CODE_SERVER_DATAROOT="$HOME/.local/share/code-server"
mkdir -p "$CODE_SERVER_DATAROOT/extensions"

# Expose the password to the server.
export PASSWORD="$password"

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

0 comments on commit 77ed174

Please sign in to comment.