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

Investigate what actions should be taken in order to run dev component without "odo dev" #4541

Open
lgrossma opened this issue Oct 9, 2024 · 4 comments
Assignees

Comments

@lgrossma
Copy link
Contributor

lgrossma commented Oct 9, 2024

No description provided.

@lgrossma lgrossma self-assigned this Oct 9, 2024
@lgrossma lgrossma moved this to 📋 Backlog in IDE Cloudaptors Oct 9, 2024
@lgrossma lgrossma moved this from 📋 Backlog to 📝 In Progress in IDE Cloudaptors Oct 9, 2024
@lgrossma
Copy link
Contributor Author

The odo dev command basically automates this process:

  1. Create an empty deployment with base image based on the tools needed (nodejs component needs node and npm for example) and leave it running indefinitely.
  2. Create volumes and mount these volumes into the container (optional)
  3. Expose ports where the application should be accessible after starting it and sets up port forwarding so the app can be accessed via localhost
  4. Syncs source code of the application to the created volumes (or directly to the container, if step 2 was omitted)
  5. Execute commands that should result in starting the application (npm install and npm start for example)
  6. Watch for changes in code and repeat steps 4-6

No info from devfile is required

@lgrossma lgrossma moved this from 📝 In Progress to 👀 In review in IDE Cloudaptors Oct 18, 2024
@adietish
Copy link
Contributor

adietish commented Oct 28, 2024

@lgrossma Excellent, detailed explanation. Thanks!

In step 4, where local code is synced to the container (not volumes), it is not evident to me how this is done. Afaik containers are read-only. Without any "special means" one would run a new container with the updated code. If no new container is spun up one would need some special means to copy the updated local classes to the containers. Rsync?

@vrubezhny, @datho7561: do you know more about it?

@datho7561
Copy link
Contributor

Afaik containers are read-only

It seems you can use kubectl cp to write files to the container.

@adietish
Copy link
Contributor

adietish commented Oct 29, 2024

Afaik containers are read-only

It seems you can use kubectl cp to write files to the container.

@datho7561: oh, indeed. nice pointer, thx!

https://kubernetes.io/docs/reference/kubectl/generated/kubectl_cp/

kubectl cp requires tar to be available in the destination pod. It looks as if kubectl cp is using tar + ssh (?) to copy to the filesystem of the pod: https://github.com/kubernetes/kubectl/blob/a49902335815c339759acdb16444c4115232c518/pkg/cmd/cp/cp.go#L300-L350

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 In review
Development

No branches or pull requests

3 participants