-
Notifications
You must be signed in to change notification settings - Fork 187
add coreos-assembler remote-session command
#2979
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
Conversation
98a6d2a to
e6d4dd6
Compare
cgwalters
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks sane to me
| // if the COREOS_ASSEMBLER_REMOTE_SESSION environment variable is | ||
| // set then we "intercept" the command here and redirect it to | ||
| // `cosa remote-session exec`, which will execute the commands | ||
| // via `podman --remote` on a remote machine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I'm hazy on is how this works with the "context directory"; e.g. is the cosa init and the git clone expected to happen remotely? Or is it local, and then podman syncs it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be able to work either way. You can cosa init locally and sync it over first or you can set up the remote session and cosa init on the remote.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds cool and magical; not a blocker for merge but would be nice add this new flow in the docs!
Or, another approach may be to land the fedora-coreos-pipeline changes, and then at least just link to that code. (I tend to learn a lot by reading about how APIs/CLIs are used in the real world and not just docs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm working on the pipeline changes and I'll post them up shortly (testing them now). Trying to work out all the kinks first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e6d4dd6 to
958c88a
Compare
04dd8d8 to
82d6a44
Compare
21290be to
a78163b
Compare
This adds a `remote-session` subcommand to coreos-assembler. The intent is for us to be able to create remote sessions on remote servers via `podman --remote` and execute builds there. This is especially attractive when considering that it elegantly enables us to do builds for a different architecture by targeting a remote host. Convenience subcommands are provided to enable easily execute arbitary remote commands (via `cosa remote-session exec shell`) and also copying files back and forth via an rsync-like interface with `cosa remote-session sync`. Here's what a typical session may look like: ``` // initialize local dir mkdir fcos && cd fcos cosa init https://github.com/coreos/fedora-coreos-config.git cosa buildfetch // initialize remote session and sync files REMOTEHOST=myhost.example.com; REMOTEUSER=builder; REMOTEUID=1001 export CONTAINER_HOST="ssh://${REMOTEUSER}@${REMOTEHOST}/run/user/${REMOTEUID}/podman/podman.sock" export COREOS_ASSEMBLER_REMOTE_SESSION=$(cosa remote-session create) cosa remote-session sync ./ :/srv/ // execute build/tests cosa fetch && cosa build && cosa kola run // sync back results cosa remote-session sync :/srv/ ./ // destroy remote session cosa remote-session destroy unset COREOS_ASSEMBLER_REMOTE_SESSION ```
a78163b to
5908faf
Compare
|
I think I've done sufficient testing on this now. I have a ton of changes to the pipeline that I need to separate into individual commits, which is going to take some time. For now here is a view of what this looks like: I think this can merge in the meantime. |
jlebon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
|
Followup thought from a demo related to this: I think the pipeline at least should have Take the example of a pipeline build that is aborted due to a test error. AIUI in the current flow, the remote container will "leak" until it times out. In this suggestion, there is an "active binding" between a process in the container on the pipeline and the remote container. When the pipeline container dies, it would break a TCP connection with the remote container and cause it to also die. |
This is easy to do by just putting the |
This is a huge change for this file. It is no mostly similar to the jobs/build.Jenkinsfile job. It now takes advantage of the `cosa remote-session` work [1] and no longer uses gangplank. [1] coreos/coreos-assembler#2979
This is a huge change for this file. It is no mostly similar to the jobs/build.Jenkinsfile job. It now takes advantage of the `cosa remote-session` work [1] and no longer uses gangplank. [1] coreos/coreos-assembler#2979
This is a huge change for this file. It is now mostly similar to the jobs/build.Jenkinsfile job. It now takes advantage of the `cosa remote-session` work [1] and no longer uses gangplank. [1] coreos/coreos-assembler#2979
This is a huge change for this file. It is now mostly similar to the jobs/build.Jenkinsfile job. It now takes advantage of the `cosa remote-session` work [1] and no longer uses gangplank. [1] coreos/coreos-assembler#2979
This is a huge change for this file. It is now mostly similar to the jobs/build.Jenkinsfile job. It now takes advantage of the `cosa remote-session` work [1] and no longer uses gangplank. [1] coreos/coreos-assembler#2979
We recently did some golang migration [1] and happened to add the `cosa remote-session` pieces [2] after that migration. This makes it not easy to backport to ther branches. For a period of time let's use the latest COSA for our COSA pod for multi-arch builds instead of the versioned COSA. We will still use the versioned COSA on the remote so the actual building will happened with the correctly versioned COSA (substituted below and passed as an argument to `cosa remote-session create --image=`). [1] coreos/coreos-assembler#2919 [2] coreos/coreos-assembler#2979
We recently did some golang migration [1] and happened to add the `cosa remote-session` pieces [2] after that migration. This makes it not easy to backport to ther branches. For a period of time let's use the latest COSA for our COSA pod for multi-arch builds instead of the versioned COSA. We will still use the versioned COSA on the remote so the actual building will happened with the correctly versioned COSA (substituted below and passed as an argument to `cosa remote-session create --image=`). [1] coreos/coreos-assembler#2919 [2] coreos/coreos-assembler#2979
We recently did some golang migration [1] and happened to add the `cosa remote-session` pieces [2] after that migration. This makes it not easy to backport to ther branches. For a period of time let's use the latest COSA for our COSA pod for multi-arch builds instead of the versioned COSA. We will still use the versioned COSA on the remote so the actual building will happened with the correctly versioned COSA (substituted below and passed as an argument to `cosa remote-session create --image=`). [1] coreos/coreos-assembler#2919 [2] coreos/coreos-assembler#2979
We recently did some golang migration [1] and happened to add the `cosa remote-session` pieces [2] after that migration. This makes it not easy to backport to ther branches. For a period of time let's use the latest COSA for our COSA pod for multi-arch builds instead of the versioned COSA. We will still use the versioned COSA on the remote so the actual building will happened with the correctly versioned COSA (substituted below and passed as an argument to `cosa remote-session create --image=`). [1] coreos/coreos-assembler#2919 [2] coreos/coreos-assembler#2979
We recently did some golang migration [1] and happened to add the `cosa remote-session` pieces [2] after that migration. This makes it not easy to backport to ther branches. For a period of time let's use the latest COSA for our COSA pod for multi-arch builds instead of the versioned COSA. We will still use the versioned COSA on the remote so the actual building will happened with the correctly versioned COSA (substituted below and passed as an argument to `cosa remote-session create --image=`). [1] coreos/coreos-assembler#2919 [2] coreos/coreos-assembler#2979
We recently did some golang migration [1] and happened to add the `cosa remote-session` pieces [2] after that migration. This makes it not easy to backport to ther branches. For a period of time let's use the latest COSA for our COSA pod for multi-arch builds instead of the versioned COSA. We will still use the versioned COSA on the remote so the actual building will happened with the correctly versioned COSA (substituted below and passed as an argument to `cosa remote-session create --image=`). [1] coreos/coreos-assembler#2919 [2] coreos/coreos-assembler#2979
We recently did some golang migration [1] and happened to add the `cosa remote-session` pieces [2] after that migration. This makes it not easy to backport to other branches. For a period of time let's use the latest COSA for our COSA pod for multi-arch builds instead of the versioned COSA. We will still use the versioned COSA on the remote so the actual building will happened with the correctly versioned COSA (substituted below and passed as an argument to `cosa remote-session create --image=`). [1] coreos/coreos-assembler#2919 [2] coreos/coreos-assembler#2979
We recently did some golang migration [1] and happened to add the `cosa remote-session` pieces [2] after that migration. This makes it not easy to backport to other branches. For a period of time let's use the latest COSA for our COSA pod for multi-arch builds instead of the versioned COSA. We will still use the versioned COSA on the remote so the actual building will happened with the correctly versioned COSA (substituted below and passed as an argument to `cosa remote-session create --image=`). [1] coreos/coreos-assembler#2919 [2] coreos/coreos-assembler#2979
This adds a
remote-sessionsubcommand to coreos-assembler. The intent is for us to be able to create remote sessions on remote servers viapodman --remoteand execute builds there. This is especially attractive when considering that it elegantly enables us to do builds for a different architecture by targeting a remote host.Convenience subcommands are provided to enable easily execute arbitary remote commands (via
cosa remote-session exec shell) and also copying files back and forth via an rsync-like interface withcosa remote-session sync.Here's what a typical session may look like: