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

feasibility-research(runtime): Support kubernetes as the backend vendor #179

Open
4 of 6 tasks
Tracked by #214
gaocegege opened this issue May 19, 2022 · 8 comments
Open
4 of 6 tasks
Tracked by #214

Comments

@gaocegege
Copy link
Member Author

gaocegege commented May 31, 2022

Actually, I am not very familiar with Kubernetes CRI, I need some time to learn it.

@gaocegege
Copy link
Member Author

	mountOption[len(mountOptionsStr)] = mount.Mount{
		Type:   mount.TypeBind,
		Source: buildContext,
		Target: base,
	}

mountOption[len(mountOptionsStr)] = mount.Mount{

We mount the build context into the docker container now, it is impossible if we use kubernetes. Maybe we need a new rule in starlark to deal with source code

@gaocegege
Copy link
Member Author

gaocegege commented May 31, 2022

	Exec(ctx context.Context, cname string, cmd []string) error
	Destroy(ctx context.Context, name string) (string, error)
	List(ctx context.Context) ([]types.Container, error)
	// GPUEnabled returns true if nvidia container runtime exists in docker daemon.
	GPUEnabled(ctx context.Context) (bool, error)
	// Start creates the container for the given tag and container name.
	StartEnvd(ctx context.Context, tag, name, buildContext string,
		gpuEnabled bool, g ir.Graph, timeout time.Duration, mountOptionsStr []string) (string, string, error)

These funcs in the docker interface should be abstracted to a new interface runtime. Both docker and k8s runtime need to implement.

@knight42
Copy link
Member

knight42 commented Jun 28, 2022

working dir mount

I think we could not mount local dir to container in k8s cluster directly, how about we spawn a rsyncd inside the container, and sync working dir by using rsync?

We cannot forward port to localhost (or maybe we can via kubectl port forward?)

This module https://pkg.go.dev/k8s.io/client-go/tools/portforward might be helpful.

@knight42 knight42 moved this from Todo to In Progress in My Open Source Work Jun 28, 2022
@gaocegege
Copy link
Member Author

I think we could not mount local dir to container in k8s cluster directly, how about we spawn a rsyncd inside the container, and sync working dir by using rsync?

Yep we may need https://syncthing.net/

@gaocegege gaocegege self-assigned this Jun 29, 2022
@gaocegege gaocegege assigned gaocegege and unassigned gaocegege Sep 9, 2022
@gaocegege
Copy link
Member Author

#dibs
/assign

@LeonardAukea
Copy link

working dir mount

I think we could not mount local dir to container in k8s cluster directly, how about we spawn a rsyncd inside the container, and sync working dir by using rsync?

We cannot forward port to localhost (or maybe we can via kubectl port forward?)

This module https://pkg.go.dev/k8s.io/client-go/tools/portforward might be helpful.

Maybe this is relevant to the discussion. @gaocegege It also utilises syncthing https://github.com/ksync/ksync/blob/master/docs/architecture.md

@gaocegege
Copy link
Member Author

working dir mount

I think we could not mount local dir to container in k8s cluster directly, how about we spawn a rsyncd inside the container, and sync working dir by using rsync?

We cannot forward port to localhost (or maybe we can via kubectl port forward?)

This module https://pkg.go.dev/k8s.io/client-go/tools/portforward might be helpful.

Maybe this is relevant to the discussion. @gaocegege It also utilises syncthing https://github.com/ksync/ksync/blob/master/docs/architecture.md

Thanks for the info! it seems like a clean wrapper of sycthing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: No status
Development

No branches or pull requests

3 participants