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

🔧 Kernel User script: joyvan -> analyticalplatform in kernel.json #64

Closed
wants to merge 4 commits into from

Conversation

Gary-H9
Copy link
Contributor

@Gary-H9 Gary-H9 commented Nov 14, 2024

Raised in relation to this issue.

Caution

This PR will only function when this PR is merged to the jupyterlab image.

Summary

This PR adds a script to automate the replacement of the string "jovyan" with "analyticalplatform" in any kernel.json files located under the base directory /home/jovyan/.local/share/jupyter/kernels.

Summary

This PR updates the script to enhance functionality by:

  1. Copying the .local directory from the source location to the target location.
  • source: /home/jovyan/.local/share/jupyter/kernels
  • target: /home/analyticalplatform/.local/share/jupyter/kernels
  1. Editing all kernel.json files in the copied directory to replace instances of jovyan with analyticalplatform.

Script Explanation

Key Features:

  1. Copy Operation:

    • The script now copies the entire .local/share/jupyter/kernels directory structure from the SOURCE_DIR (/home/jovyan/.local/share/jupyter/kernels) to the TARGET_DIR (/home/analyticalplatform/.local).
    • Ensures all subdirectories are included in the copy. (I've tested this locally)
  2. Kernel Editing:

    • Searches for all kernel.json files within the target directory (/home/analyticalplatform/.local/share/jupyter/kernels).
    • Replaces occurrences of jovyan with analyticalplatform using sed.

Note:

  • SOURCE_DIR: Location of the source files.
  • TARGET_DIR: Base directory for the copied files.
  • BASE_DIR: Subdirectory where kernel.json files are located for editing.

@jacobwoffenden
Copy link
Member

This logic will be moved to JLab image.

@jacobwoffenden jacobwoffenden deleted the kjupyter/kernel branch November 21, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants