diff --git a/Core/Panel/Dockerfile b/Core/Panel/Dockerfile index 4ff6c69..3f0df20 100644 --- a/Core/Panel/Dockerfile +++ b/Core/Panel/Dockerfile @@ -15,6 +15,7 @@ # automatically when running in Edge, or by the "ci" module when running # locally. + # First stage ARG BASE_IMAGE=quay.io/enthought/edm-centos-7:latest @@ -46,9 +47,6 @@ COPY --from=stage_one --chown=app /home/app/.edm /home/app/.edm # Don't change the user, and in particular don't make the user "root". # Copy startup script and application. -# Note: the startup script must be placed in /home/app for the base image -# machinery to pick it up. - COPY --chown=app ./src/startup-script.sh /home/app/startup-script.sh RUN chmod +x /home/app/startup-script.sh COPY --chown=app ./src/app.py /home/app/app.py diff --git a/Core/React/Dockerfile b/Core/React/Dockerfile index 9e5db14..5881c2d 100644 --- a/Core/React/Dockerfile +++ b/Core/React/Dockerfile @@ -18,7 +18,7 @@ # First stage -ARG BASE_IMAGE=quay.io/enthought/edm-centos-7:3.4.0 +ARG BASE_IMAGE=quay.io/enthought/edm-centos-7:latest FROM $BASE_IMAGE as stage_one diff --git a/Core/React/README.md b/Core/React/README.md index 43a7ef8..b4733f9 100644 --- a/Core/React/README.md +++ b/Core/React/README.md @@ -99,8 +99,7 @@ collecting environment variables set by Edge when the container is launched. When developing locally, it's also convenient to have an EdgeSession. You can get the "ci" module to inject the appropriate environment variables, so -that your ``EdgeSession()`` call will work with ``python -m ci run`` and -``python -m ci preflight``. +that your ``EdgeSession()`` call will work with ``python -m ci run``. To do so, follow this procedure: @@ -109,8 +108,8 @@ To do so, follow this procedure: ``"https://edge.enthought.com/services/api"``. * Define EDGE_API_ORG in that file. This is the "short name" displayed in the URL bar when you log into an organization, for example, ``"default"``. -* Define EDGE_API_TOKEN. You can get one of these by going to the - ``/hub/token`` endpoint on the Edge server. +* Define EDGE_API_TOKEN. You can get one of these from the ``My Profile``page + in the Edge UI. Be sure *not* to check the "dev_settings.json" file into source control, as it contains your API token. @@ -138,16 +137,7 @@ found. ## Viewing console output When running with ``python -m ci run``, the app's output will be displayed -on the console where you launched it. Once you've launched your app locally, -you can use the ``docker logs``command to see output: - -``` -$ docker logs edge-react-core -f -``` - -(If you've changed the IMAGE constant in ``ci/__main__.py``, replace -"edge-react-core" above with the new image name). - +on the console where you launched it. ## Guidelines for your Dockerfile @@ -157,9 +147,6 @@ the prefix from requests, handling the OAuth2 login flow, pinging JupyterHub for container activity, and more. But, there are a few guidelines you will need to follow in your own Dockerfile. -* Don't change the user to anything other than ``app`` (for example, by the - Dockerfile ``USER`` command). If you need to run ``yum`` for some reason, - use ``sudo``. * Your app should bind to ``127.0.0.1``, *not* ``0.0.0.0``, and it should serve on port 9000. The Edge machinery will respond to requests on port 8888 and forward them to your app. diff --git a/Core/React/ci/__main__.py b/Core/React/ci/__main__.py index 573ec3a..7a4cc3b 100644 --- a/Core/React/ci/__main__.py +++ b/Core/React/ci/__main__.py @@ -38,7 +38,7 @@ "six", ] -# This will be used when running locally ("run" or "preflight" commands). +# This will be used when running locally ("run" command). # We just use the last component of the full image URL. CONTAINER_NAME = IMAGE.split("/")[-1] @@ -90,8 +90,6 @@ def run(): """Run the Docker image for testing""" # Get values from the dev settings file (API tokens for testing, etc.) - # Because we are running outside of JupyterHub, we also disable the OAuth2 - # machinery. envs = _load_dev_settings() cmd = ["docker", "run", "--rm", "-p", "9000:9000", "--name", CONTAINER_NAME]