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

Remote image deploy #194

Merged
merged 8 commits into from Nov 4, 2022
Merged

Remote image deploy #194

merged 8 commits into from Nov 4, 2022

Conversation

Szubie
Copy link
Collaborator

@Szubie Szubie commented Nov 4, 2022

This PR enables use of image stored in remote LXD servers in Bravefiles. These remote images can be used as "Base" images during build or as "source" images during container deployment. In addition, during the build phase it is now possible to push the resulting image into a remote LXD server.

An example Bravefile using these features:

image: store:test-image/1.0
base:
  image: store:alpine/edge

service:
  name: deploy:python-api

During build:
The "store" remote provides the base image for the build phase ("alpine/edge"). The resulting image "test-image/1.0" is built and then pushed into the "store" remote server.

During deploy:
The "store" remote holds the source image "test-image/1.0" to be deployed as a container. If bravetools does not have a local copy of the image already it will import it from the "store" remote. Then the resulting container will be pushed to the "deploy" remote.

Bravetools will always make a local copy of images it imports when possible, whether during build or if deploying a remotely stored image. Local images will be prioritized over remotely stored images if present; this last point may be debated - perhaps it's better to do the opposite and favour remote images by default instead? Or perhaps some validation could be done like checking fingerprints.

The mechanism used to import these images is the same as brave base, meaning a container will be spun up and turned into an image and exported as a single .tar.gz file.

…es are exported from remote into local bravetools imagestore before deployment. Issues occur when two-part image files are used.
…g a remotely stored image, create a minimal Bravefile and build the image to create unified tarfile for bravetools image store before proceeding with the deployment.
…If a remote is provided, set location to private and keep the remote as part of base image name.
…ly guarantee that bravetools host can connect to both remotes
… already exists in local image store skip build and push to remote
… image from dest server. Also add checks to ensure that image does not exist at dest server already prior to transfer.
@idroz idroz merged commit 6c1362e into bravetools:master Nov 4, 2022
@Szubie Szubie deleted the remote-image-deploy branch December 21, 2022 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants