Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add demo repositories mechanism to populate user's space #2207

Merged
merged 20 commits into from
Jan 18, 2024

Conversation

viniciusdc
Copy link
Contributor

@viniciusdc viniciusdc commented Jan 17, 2024

Reference Issues or PRs

closes #2179

What does this implement/fix?

This PR exposes/introduces a new way to easily instantiate GitHub repositories in the user superlab pod during launch time. This helps streamline demos, examples, and other data that the administrator considers needed for any user who starts using the platform.

Description

The primary goal of this PR is to streamline the initialization and distribution of the Git repositories when a user first launches its JupyterLab instance. The main addition is simplifying the script's command-line arguments to make it easier to use within a Kubernetes context.

In the nebari-config.yaml side, a new field was included (optional) to distribute the location where the given repository will be cloned into (relative to the user /home directory) and its URL.
block syntax

jupyterlab:
  initial_repositories:
    - <path/to/folder>: <github/repository/url>
    - <path/to/folder/or/subfolder>: <github/repository/url>
    - ...

Put a x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds a feature)
  • Breaking change (fix or feature that would cause existing features not to work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Other (please describe):

Testing

  • Did you test the pull request locally?
  • Did you add new tests?

Any other comments?

@viniciusdc
Copy link
Contributor Author

Currently fixing an issue with permissions when executing the script, will commit the update in a few minutes once that's fixed

@viniciusdc viniciusdc changed the title Add pre-populate examples fodlers (git repos) into users space Add demo repositories mechanism to populate user's space Jan 17, 2024
@viniciusdc
Copy link
Contributor Author

Fixed, now I will rename the yaml config field based on the suggestions given on the issue

@viniciusdc
Copy link
Contributor Author

I've done some testing already, but now I will check with the examples we discussed during the last meeting

@viniciusdc
Copy link
Contributor Author

Here are some tests by specifying the following in the nebari-config.yaml:

jupyterlab:
  initial_repositories:
    - examples/nebari-demo: https://github.com/nebari-dev/nebari-demo.git
    - examples/big-data: https://github.com/nebari-dev/big-data-tutorial-90min.git

Screenshot from the initContainer running the clone:

Captura de tela de 2024-01-17 21 44 33

Image from the jupyterlab user pod:

Captura de tela de 2024-01-17 21 45 09

** Permission given to any git repository created by this method will always be 1000:100, which as of now, always maps to <current-user:<users-group>>

When the pod is restarted, the script does not run again if the git repos already exists:

Captura de tela de 2024-01-17 21 46 56

@viniciusdc viniciusdc requested a review from costrouc January 18, 2024 00:56
@pavithraes pavithraes added this to the 2024.1.1 milestone Jan 18, 2024
@dcmcand dcmcand merged commit 57db83b into nebari-dev:develop Jan 18, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

[ENH] - Mechanism to pre-populate Nebari with demo/example content
3 participants