Skip to content
Snippets Groups Projects
Commit 4a36ccb5 authored by Chris Hines's avatar Chris Hines
Browse files

see if it builds with the restructure

parent f57035bd
No related branches found
No related tags found
4 merge requests!77Revert "disable agressive kill and restart",!35Dev,!30Test,!29Dev
Pipeline #10668 failed
......@@ -5,11 +5,6 @@ RUN apt update
RUN apt install -y python3 gcc python3-pip
RUN apt install -y openssh-client
RUN pip3 install -r requirements.txt
RUN pwd
RUN ls
RUN cd TES ; python3 ./setup.py install
RUN pwd
RUN ls
RUN cd TWS ; python3 ./setup.py install
RUN python3 ./setup.py install
EXPOSE 8080 8090
CMD ["./runscript"]
......@@ -78,7 +78,8 @@ setup(
'sqlalchemy',
'pyyaml',
'flask_restful',
'flask-oauthlib',
'flask_cors',
'requests'
],
......@@ -88,7 +89,7 @@ setup(
# "scripts" keyword. Entry points provide cross-platform support and allow
# pip to create the appropriate form of executable for the target platform.
entry_points={
'console_scripts': [ 'wsgi_app=tes:tes_wsgi', 'vnclaunch=vnclaunch.__main__:main','runserver=runserver:main'],
'console_scripts': [ 'wsgi_app=tes:tes_wsgi', 'vnclaunch=vnclaunch.__main__:main','runserver=runserver.__main__:main'],
'gui_scripts': [ ]
},
)
File moved
File moved
......@@ -438,6 +438,10 @@ class AppUrl(Resource):
#flask_restful.abort(500,message="AppUrl failed in some unexpected way")
return apiabort(500,message="AppUrl failed in some unexpected way")
class Ping(Resource):
def get(self):
return None, 201
class AppLaunch(Resource):
def get(self):
import logging
......@@ -448,11 +452,13 @@ class AppLaunch(Resource):
cmd = "{}".format(appdef['client']['cmd'].format(**inst)).split()
import subprocess
try:
logger.debug('launching subprocess')
p = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
(stdout,stderr) = p.communicate()
logger.debug('subprocess completed')
if p.returncode != 0:
if stderr != "":
msg = stderr
msg = stderr.decode()
else:
msg = "Unable to start the program {}".format(appdef['client']['cmd'])
return apiabort(500,message=msg)
......@@ -460,13 +466,14 @@ class AppLaunch(Resource):
return apiabort(500,message="Unable to find the program {}".format(appdef['client']['cmd']))
pass
return None
except Exception as e:
import traceback
logger.error(e)
logger.error(traceback.format_exc())
#flask_restful.abort(500,message="AppUrl failed in some unexpected way")
return apiabort(500,message="AppUrl failed in some unexpected way")
logger.debug('application launched, returning')
return {'msg':'launch success'}, 200
class AppInstance(Resource):
def get(self, username, loginhost, batchhost, jobid):
......@@ -578,6 +585,7 @@ class CreateTunnel(Resource):
api.add_resource(TunnelstatEP, '/tunnelstat/<string:authtok>')
api.add_resource(GetCert, '/getcert')
api.add_resource(JobStat, '/stat')
api.add_resource(Ping, '/ping')
api.add_resource(JobCancel, '/cancel/<int:jobid>')
api.add_resource(JobSubmit, '/submit')
api.add_resource(CreateTunnel, '/createtunnel/<string:username>/<string:loginhost>/<string:batchhost>')
......
File moved
File moved
......@@ -28,6 +28,15 @@ class SSHSession:
def start_agent(self):
import subprocess
from .. import app
import logging
import os
logger = logging.getLogger()
logger.debug('starting agent')
if app.config['ENABLELAUNCH'] and os.environ['SSH_AUTH_SOCK']:
logger.debug('using existing agent')
self.socket = os.environ['SSH_AUTH_SOCK']
return
p = subprocess.Popen([self.sshagent],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
(stdout,stderr) = p.communicate()
for l in stdout.decode().split(';'):
......
File moved
File moved
File moved
......@@ -3,10 +3,16 @@ def main():
port = sys.argv[1]
passwd = sys.argv[2]
import subprocess
p = subprocess.Popen(['vncpasswd','-f'],stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
(encpass,stderr) = p.communicate(passwd)
passwd = passwd + '\n'
p = subprocess.Popen(['vncviewer','-autopass','localhost::{}'.format(port)],stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
p.communicate(passwd)
p.stdin.write(passwd.encode())
p.stdin.close()
if p.poll() == None:
sys.exit(0)
else:
sys.stderr.write(p.stderr.read())
sys.exit(1)
if __name__ == "__main__":
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment