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

feat: Support SSH #43

Merged
merged 10 commits into from
Apr 23, 2022
Merged

feat: Support SSH #43

merged 10 commits into from
Apr 23, 2022

Conversation

VoVAllen
Copy link
Member

@VoVAllen VoVAllen commented Apr 22, 2022

Ref #16

Copy the midi-ssh into the container.

Found that the username used to ssh doesn't matter (i.e. ssh ubuntu@xxxx and ssh root@xxx both works)

TODO:

  • Properly set the build context

@VoVAllen VoVAllen added status/blocked 🚧 help wanted 🆘 Extra attention is needed and removed help wanted 🆘 Extra attention is needed status/blocked 🚧 labels Apr 22, 2022
@@ -112,6 +112,10 @@ func actionBuild(clicontext *cli.Context) error {
},
},
},
LocalDirs: map[string]string{
// TODO: how to properly select build context?
"context": "/home/ubuntu/workspace/MIDI/",
Copy link
Member Author

Choose a reason for hiding this comment

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

How to properly specify context now?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we could use the current dir as the build context?

@VoVAllen VoVAllen requested a review from gaocegege April 22, 2022 14:39
Copy link
Member

@gaocegege gaocegege left a comment

Choose a reason for hiding this comment

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

Generally LGTM

@@ -112,6 +112,10 @@ func actionBuild(clicontext *cli.Context) error {
},
},
},
LocalDirs: map[string]string{
// TODO: how to properly select build context?
"context": "/home/ubuntu/workspace/MIDI/",
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we could use the current dir as the build context?

func (g Graph) copyMidiSSHServer(root llb.State) llb.State {
run := root.File(llb.Mkdir("/var/midi/remote/", 0700, llb.WithParents(true))).
File(llb.Mkdir("/var/midi/bin/", 0700, llb.WithParents(true))).
File(llb.Copy(llb.Local("context"), "examples/ssh_keypairs/public.pub", "/var/midi/remote/authorized_keys")).
Copy link
Member

Choose a reason for hiding this comment

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

We can open an issue to keep track of this hard-coded key.

@gaocegege
Copy link
Member

Please rebase the main branch

cmd/midi/build.go Outdated Show resolved Hide resolved
@VoVAllen VoVAllen merged commit d630eaf into main Apr 23, 2022
@VoVAllen VoVAllen deleted the ssh branch April 23, 2022 12:47
@gaocegege gaocegege mentioned this pull request Apr 24, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants