-
Notifications
You must be signed in to change notification settings - Fork 155
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
WIP: Cloud upload #826
WIP: Cloud upload #826
Conversation
Great job! This is looking really nice. Here's my list of comments:
It also feels like these new API routes would be a good candidate for a v1 API instead of adding them to v0, which would also make it easier for the front-ends to figure out what's supported. |
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.
This is looking pretty good! I think all the pieces are now there, it just needs some cleanup:
- squash related commits, with descriptive commit messages
- split out commits like the change to the toml module into their own.
- Either add my API v1 commit from pr Add id field to source and change name to use the repo.name instead of repo.id #699 or rebase on top of it and move the new API calls into there. Or you could review that PR and I could push it :)
- Add full docstrings to the new functions.
- Tests. Unit tests where relevant, as well as cloud upload tests, maybe replacing the current ones? See what @atodorov thinks.
Great, thanks! I'll just rebase on top of your v1 branch. |
Currently, Azure, vSphere, and OpenStack are supported. See weldr#826 for more details about this new feature. I've called the upload library "lifted" as a reference to Seuss' The Lorax -- in the book, the Lorax lifts himself up by the seat of his pants through a hole in the smog clouds, and they start calling him the "Lifted Lorax."
Support multiple named settings profiles instead of having one set of saved settings per provider Serialize via TOML instead of pickle
Allow multiple providers to support the same image type. Instead of inferring upload provider from the compose type, users must now pass a "provider" name when scheduling an upload.
Currently, Azure, vSphere, and OpenStack are supported. See weldr#826 for more details about this new feature. I've called the upload library "lifted" as a reference to Seuss' The Lorax -- in the book, the Lorax lifts himself up by the seat of his pants through a hole in the smog clouds, and they start calling him the "Lifted Lorax." This adds new features to the /compose route under API v1
See PR #843 for continued work on this. |
Currently, Azure, vSphere, and OpenStack are supported. See weldr#826 for more details about this new feature. I've called the upload library "lifted" as a reference to Seuss' The Lorax -- in the book, the Lorax lifts himself up by the seat of his pants through a hole in the smog clouds, and they start calling him the "Lifted Lorax." This adds new features to the /compose route under API v1
Currently, Azure, vSphere, and OpenStack are supported. See weldr#826 for more details about this new feature. I've called the upload library "lifted" as a reference to Seuss' The Lorax -- in the book, the Lorax lifts himself up by the seat of his pants through a hole in the smog clouds, and they start calling him the "Lifted Lorax." This adds new features to the /compose route under API v1
Currently, Azure, vSphere, and OpenStack are supported. See weldr#826 for more details about this new feature. I've called the upload library "lifted" as a reference to Seuss' The Lorax -- in the book, the Lorax lifts himself up by the seat of his pants through a hole in the smog clouds, and they start calling him the "Lifted Lorax." This adds new features to the /compose route under API v1
Currently, Azure, vSphere, and OpenStack are supported. See weldr#826 for more details about this new feature. I've called the upload library "lifted" as a reference to Seuss' The Lorax -- in the book, the Lorax lifts himself up by the seat of his pants through a hole in the smog clouds, and they start calling him the "Lifted Lorax." This adds new features to the /compose route under API v1
Currently, Azure, vSphere, and OpenStack are supported. See weldr#826 for more details about this new feature. I've called the upload library "lifted" as a reference to Seuss' The Lorax -- in the book, the Lorax lifts himself up by the seat of his pants through a hole in the smog clouds, and they start calling him the "Lifted Lorax." This adds new features to the /compose route under API v1
Currently, Azure, vSphere, and OpenStack are supported. See weldr#826 for more details about this new feature. I've called the upload library "lifted" as a reference to Seuss' The Lorax -- in the book, the Lorax lifts himself up by the seat of his pants through a hole in the smog clouds, and they start calling him the "Lifted Lorax." This adds new features to the /compose route under API v1
Currently, Azure, vSphere, and OpenStack are supported. See weldr#826 for more details about this new feature. I've called the upload library "lifted" as a reference to Seuss' The Lorax -- in the book, the Lorax lifts himself up by the seat of his pants through a hole in the smog clouds, and they start calling him the "Lifted Lorax." This adds new features to the /compose route under API v1
Thought now would be an appropriate time to start a conversation about the progress on cloud upload so far. I'll start by describing the high-level design and then lay out what I think still needs to be done.
I've managed to keep the bulk of the upload logic separate from the rest of lorax. It currently exists as a package called "lifted" in src/lifted. Uploads are queued and stored in a way similar to how composes are. When an upload is scheduled, an Upload object is created with the upload's settings and state, and this object gets serialized and written to
/var/lib/lorax/upload/queue/$upload_uuid
. If an upload is scheduled from a compose that isn't finished yet, the upload starts with a status of "WAITING". As soon as the associated compose finishes, the upload gets marked "READY". A monitor thread watches for "READY" uploads, kicks each one off as separate process, and marks them as "RUNNING". Since each running upload gets its own PID, we can cancel an upload simply by sending it a SIGINT.The actual uploading is done using Ansible playbooks and the Ansible cloud modules. I currently have uploads to Azure, vSphere, and OpenStack working. Each cloud provider has both a
provider.toml
file containing some metadata (mostly describing the credentials and settings it expects) and aplaybook.yaml
. When a provider's settings get saved for future use, they're written to/var/lib/lorax/upload/settings/$provider_name.toml
.The API should now support most of what we'll need on the front end, including:
Some things we still need to work on:
python3-ansible-runner
installed, and right now lorax-composer just crashes if it's missing. Furthermore, each cloud provider has its own set of dependencies. API routes should return some special error if any required package is missing, and Cockpit would ideally offer a one-click install.For now, the following installations should be all you need to get Azure, OpenStack, and vSphere working: