HTTPS Apps
Run applications that are accessible via HTTPS.
Overview
A license is required to run HTTPS applications on the DNAnexus Platform. Contact DNAnexus Sales for more information.
Historically, DNAnexus applications have been used for batch executions and pipeline processing. Cloud Workstation is an example of an interactive use case for a DNAnexus worker and job, but it is accessible only via SSH configured for a single user.
Now DNAnexus jobs can be accessed interactively via a browser at https://job-xxxx.dnanexus.cloud
via an HTTPS proxy which handles all of the necessary authentication. This allows a user to host an unencrypted webapp within a job and rely on the platform to provide access and security.
Quickstart
This application illustrates how to add httpsApp
to your dxapp.json
and run a hello-world web server with Docker. Listening on port 443 externally is the worker's HTTPS proxy, which will authenticate the user with DNAnexus and generate a session for the browser.
After the job has been assigned and transitioned to the running
state, the URL https://job-xxxx.dnanexus.cloud
is created. This URL is accessible once it has propogated to your DNS server (generally within 60 seconds). Below is the source code for an applet running a web server on port 443.
src/hello-world-webapp.sh
src/hello-world-webapp.sh
dxapp.json
dxapp.json
To make the applet an HTTPS enabled, a new field httpsApp
is required in the dxapp.json of the applet. This field requires ports
and shared_access
keys. ports
is an array of integers with 443
, 8080
, and 8081
as allowed values. shared_access
is a string, with VIEW
, CONTRIBUTE
, ADMINISTER
, or NONE
as possible values. This value restricts access to users with at least the specified access to the project in which the job executes, or to only the launching user if NONE
is set. In this example access is restricted to DNAnexus users with at least VIEW access to the project in which the job executes.
Ubuntu 20.04 is recommended and has native support for docker
. Outbound network access is enabled to pull the image from DockerHub.
Running and Accessing the Job
Build the applet
Run applet
Wait until job is running and get URL
Navigate to
https://job-xxxx.dnanexus.cloud
Use Cases
Interactive tools for exploring data
Notes and Issues
Accessing the URL for the first time will redirect the browser to the DNAnexus login page for authentication, the browser then redirects back to the web application
Sessions expire after 15 minutes of inactivity (defined as any HTTP request sent through the proxy), redirecting the user back to the DNAnexus login page
It is possible to access the job via the HTTPS proxy before the application inside the job is ready to serve requests. This results in the
502 Bad Gateway
error. The reason for this is that the application may have not finished setting up dependencies and is not running yet. It could also be configured to listen on an incorrect port.
Last updated