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

update jupterhub config to enable docker spanwer #98

Merged
merged 9 commits into from
Sep 25, 2024
Merged

Conversation

Tianhao-Gu
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 47.51%. Comparing base (f9d00f7) to head (d2edc64).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/jupyterhub_config/custom_docker_spawner.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
- Coverage   47.75%   47.51%   -0.24%     
==========================================
  Files           7        7              
  Lines         400      402       +2     
==========================================
  Hits          191      191              
- Misses        209      211       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@MrCreosote MrCreosote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty hard for me to completely understand the whole picture, but I don't see any huge issues

c.DockerSpawner.network_name = network_name
c.DockerSpawner.use_internal_ip = True
environment = os.environ.get('ENVIRONMENT', 'prod').lower()
c.DockerSpawner.remove = environment != 'dev'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment describing the purpose of this line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what conditions does the container get removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when the container stops (error, user can also manually restart spawner).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user can also manually restart spawner

Here you're talking about the user image right? Not the user image spawner?

How would the user restart the spawner?

Can you update the comment to explain when the image is removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator Author

@Tianhao-Gu Tianhao-Gu Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you're talking about the user image right? Not the user image spawner?

yea the user image. Not jupyterhub server.

How would the user restart the spawner?

On the home page, users can stop and restart server. Similar to NERSC.

Screenshot 2024-09-25 at 2 05 18 PM

docker-compose.yaml Show resolved Hide resolved
docker-compose.yaml Show resolved Hide resolved
# Created by `docker network create cdm-jupyterhub-network`
cdm-jupyterhub-network:
external: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does external do here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it indicates the network is created by docker network create. I wasn't able to get it working locally with docker compose created networks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What implications does that have?

Do you have to do something similar in Rancher?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am working with Devops on this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so it's not clear what's going to happen in rancher yet.

I still don't understand what the difference is between the two network modes in docker compose

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the one docker compose created automatically, I couldn't get jupterhub working locally. Hostname is not resolved correctly which is what we see in Rancher now. I don't know I have the best answer for this question. Still trying to figure it out. But with this setting, at least I can get jupterhub working properly locally with docker compose.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sounds like this is "well it works but I don't know why" situation.

The reason I was asking this is because I don't know how that would translate to Rancher and if it'd have any security implications

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea. I think I will try to understand and how it works in Rancher and maybe come back and update docker compose to make it similar if not the same as Rancher.

docker-compose.yaml Show resolved Hide resolved
scripts/notebook_entrypoint.sh Show resolved Hide resolved
@Tianhao-Gu Tianhao-Gu merged commit 5d7afe6 into main Sep 25, 2024
7 of 10 checks passed
@Tianhao-Gu Tianhao-Gu deleted the dev_jupyterhub branch September 25, 2024 19:23
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