nmfs-opensci / py-rocket-2

take 2 on py-rocket-base
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

py-rocket-base: just the jupyterhub packages and infrastructure #4

Closed eeholmes closed 3 days ago

eeholmes commented 5 days ago

Just the JupyterHub (+Python) and all the niceties (utils) but no actual science packages or applications.

eeholmes commented 5 days ago

Friday Oct 4, ran into big problems. I editted the cryo image too much and the image would not start. Each test is taking 30 minutes + so slow making progress and debugging the problem

Slowly change things and check that the image keeps starting:

eeholmes commented 5 days ago

original start. this works

#!/bin/bash
set -euo pipefail

# Set any environment variables here
# These are inherited by all processes, *except* RStudio

# Tell applications where to open desktop apps - this allows notebooks to
# pop open GUIs
export DISPLAY=":1.0"

# Tell gh-scoped-creds which GitHub app to use for push access
# See https://github.com/jupyterhub/gh-scoped-creds#github-app-configuration
export GH_SCOPED_CREDS_CLIENT_ID="Iv1.bd27058fd393e285"
export GH_SCOPED_CREDS_APP_URL="https://github.com/apps/cryocloud-github-access"

# Add any .desktop files to the application database and desktop. This is done
# at startup-time because it's expected that a remote filesystem will be
# mounted at $HOME, which would overwrite the data if it was created at
# build-time.
APPLICATIONS_DIR="${HOME}/.local/share/applications"
DESKTOP_DIR="${HOME}/Desktop"
mkdir -p "${APPLICATIONS_DIR}"
mkdir -p "${DESKTOP_DIR}"
for desktop_file_path in ${REPO_DIR}/*.desktop; do
    cp "${desktop_file_path}" "${APPLICATIONS_DIR}/."

    # Symlink application to desktop
    desktop_file_name="$(basename ${desktop_file_path})"
    ln -sf "${APPLICATIONS_DIR}/${desktop_file_name}" "${DESKTOP_DIR}/${desktop_file_name}"
done
update-desktop-database "${APPLICATIONS_DIR}"

# Add MIME Type data from XML files in `mime/` dir to the MIME database.
MIME_DIR="${HOME}/.local/share/mime"
MIME_PACKAGES_DIR="${MIME_DIR}/packages"
mkdir -p "${MIME_PACKAGES_DIR}"
for mime_file_path in ${REPO_DIR}/mime/*.xml; do
    cp "${mime_file_path}" "${MIME_PACKAGES_DIR}/."
done
update-mime-database "${MIME_DIR}"

exec "$@"

minimal

#!/bin/bash
set -euo pipefail

exec "$@"

want this. pretty much everything except the gh-scoped stuff

#!/bin/bash
set -euo pipefail

# Set any environment variables here
# These are inherited by all processes, *except* RStudio

# Tell applications where to open desktop apps - this allows notebooks to
# pop open GUIs
export DISPLAY=":1.0"

# Add any .desktop files to the application database and desktop. This is done
# at startup-time because it's expected that a remote filesystem will be
# mounted at $HOME, which would overwrite the data if it was created at
# build-time.
APPLICATIONS_DIR="${HOME}/.local/share/applications"
DESKTOP_DIR="${HOME}/Desktop"
mkdir -p "${APPLICATIONS_DIR}"
mkdir -p "${DESKTOP_DIR}"
for desktop_file_path in ${REPO_DIR}/*.desktop; do
    cp "${desktop_file_path}" "${APPLICATIONS_DIR}/."

    # Symlink application to desktop
    desktop_file_name="$(basename ${desktop_file_path})"
    ln -sf "${APPLICATIONS_DIR}/${desktop_file_name}" "${DESKTOP_DIR}/${desktop_file_name}"
done
update-desktop-database "${APPLICATIONS_DIR}"

# Add MIME Type data from XML files in `mime/` dir to the MIME database.
MIME_DIR="${HOME}/.local/share/mime"
MIME_PACKAGES_DIR="${MIME_DIR}/packages"
mkdir -p "${MIME_PACKAGES_DIR}"
for mime_file_path in ${REPO_DIR}/mime/*.xml; do
    cp "${mime_file_path}" "${MIME_PACKAGES_DIR}/."
done
update-mime-database "${MIME_DIR}"

exec "$@"
eeholmes commented 4 days ago

Needed to add shopt -s nullglob to start #7

eeholmes commented 3 days ago

Completed the basic structure: various utils for a nice jupyterlab and shell environment. Desktop app ready via the start script that loads *.desktop and mime/*.xml in the right places but doesn't crash if there are none of these files. Next up is R integration and testing.