Commit 9d33e22a authored by Stefano Alberto Russo's avatar Stefano Alberto Russo
Browse files

Fixes.

parent e79acd05
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -7,6 +7,12 @@ set -e
echo ""
echo "[INFO] Executing entrypoint..."

if [ "x$BASE_PORT" == "x" ]; then
    echo "[INFO] No task base port set, will set noVNC port 8590 and VNC port 5900 with desktop id \"0\""  
else 
    echo "[INFO] Task base port set, will set noVNC port $BASE_PORT and noVNC port $(($BASE_PORT+1)) with desktop id \"$(($BASE_PORT-5900+1))\""
fi

#---------------------
#   Setup home
#---------------------
+4 −4
Original line number Diff line number Diff line
@@ -2,11 +2,11 @@

# Exec TigerVNC server 

if [ "x$TASK_PORT" == "x" ]; then
if [ "x$BASE_PORT" == "x" ]; then
    /usr/lib/noVNC/utils/launch.sh --listen 8590
    echo "Running noVN on port 8590"
    echo "Running noVNC on port 8590"
else
    /usr/lib/noVNC/utils/launch.sh --listen $TASK_PORT
    echo "Running noVN on port $TASK_PORT"
    /usr/lib/noVNC/utils/launch.sh --listen $BASE_PORT --vnc localhost:$(($BASE_PORT+1))
    echo "Running noVNC on port $BASE_PORT and connecting to VNC on port $(($BASE_PORT+1))"

fi
+8 −2
Original line number Diff line number Diff line
@@ -2,10 +2,16 @@

# Exec TigerVNC server 

if [ "x$BASE_PORT" == "x" ]; then
    DESKTOP_NUMBER=0
else
    DESKTOP_NUMBER=$(($BASE_PORT-5900+1))
fi

if [ "x$VNC_AUTH" == "xTrue" ]; then
    /opt/tigervnc/usr/bin/vncserver :0 -SecurityTypes vncauth,tlsvnc -xstartup /opt/tigervnc/xstartup
    /opt/tigervnc/usr/bin/vncserver :$DESKTOP_NUMBER -SecurityTypes vncauth,tlsvnc -xstartup /opt/tigervnc/xstartup
else
    /opt/tigervnc/usr/bin/vncserver :0 -SecurityTypes None -xstartup /opt/tigervnc/xstartup
    /opt/tigervnc/usr/bin/vncserver :$DESKTOP_NUMBER -SecurityTypes None -xstartup /opt/tigervnc/xstartup
fi


+5 −0
Original line number Diff line number Diff line
@@ -22,3 +22,8 @@ COPY slurm.conf /etc/slurm-llnl/slurm.conf
# TODO: why do we need this?
RUN ln -s /var/lib/slurm-llnl /var/lib/slurm-wlm 
RUN ln -s /var/log/slurm-llnl /var/log/slurm-wlm

# Add slurmtestuser user
RUN useradd slurmtestuser
RUN cp -a /rosetta/.ssh /home/slurmtestuser
RUN chown -R slurmtestuser:slurmtestuser /home/slurmtestuser   
+7 −5
Original line number Diff line number Diff line
@@ -260,18 +260,20 @@ from random import randint
while True:

    # Get a random ephimeral port
    port = randint(49152, 65535)
    port = randint(49152, 65535-2)

    # Check port is available
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    result = sock.connect_ex(('127.0.0.1', port))
    if result == 0:
        print('Found not available ephimeral port ({}) , choosing another one...'.format(port))
    result1 = sock.connect_ex(('127.0.0.1', port))
    result2 = sock.connect_ex(('127.0.0.1', port+1))
    result3 = sock.connect_ex(('127.0.0.1', port+2))
    if (result1 == 0) or (result2 == 0) or (result3 == 0):
        logger.info('Found not available ephemeral port triplet ({},{},{}) , choosing another one...'.format(port,port+1,port+2))
        import time
        time.sleep(1)
    else:
        break
logger.info(' - port: "{}"'.format(port))
logger.info(' - ports: "{},{},{}"'.format(port, port+1, port+2))

response = urlopen("'''+host_conn_string+'''/api/v1/base/agent/?task_uuid={}&action=set_ip_port&ip={}&port={}".format(task_uuid, ip, port))
response_content = response.read() 
Loading