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

image inference from docker-compose, with multi-image support #17

Open
1 task done
ethanknox-palmetto opened this issue Nov 16, 2021 · 2 comments
Open
1 task done
Labels
enhancement New feature or request

Comments

@ethanknox-palmetto
Copy link
Contributor

Context
Lots of projects are complex and use more than one image. this is where palm could shine, if it supported multiple images

Is your feature request related to a problem? Please describe.
let's say I have a rails app. I've got a rails container, a postgres container, an nginx static file serve etc all in the local.
sometimes I want to run the rails test suite in the rails_app container. sometimes I want to force compile my static files in the static_server container. I need more than one.

Describe the solution you'd like
A well-documented heuristic. palm finds and parses the docker-compose, loading all the images into the context. the default is the first image in the file. setting a different default in the config changes that. Now in the context I can specify an override image name from the context, or leave it blank to use the default.
This also speeds up fails because we can parse the image list before running the docker command and short-circuit if it is not a valid image name.

Describe alternatives you've considered

  • refactoring projects into a mono image, which is awful.
  • shelling out and hand writing the compose, which is fine but takes away a LOT of palm magic

Is there an existing feature request for this?

  • I have searched the existing issues
@ethanknox-palmetto ethanknox-palmetto added the enhancement New feature or request label Nov 16, 2021
@jakeberesford-palmetto
Copy link
Collaborator

Multi-image support is a critical improvement for supporting more complex applications.

Some thoughts:

  • palm build is no-longer useful
  • we should provide a set of commands via a plugin (in this repo)
    • projects configured to use that plugin would have access to up/down/exec/logs etc.
  • we would need to think about .palm/config.yaml for those projects

This could also be a separate plugin, but it feels like core functionality.

@jakeberesford-palmetto
Copy link
Collaborator

@ethanknox-palmetto - I started a branch for this! I've created a new (core) plugin called multi_container with the basic plugin setup and bare-bones up/down commands. This would be an excellent place for you or anyone else in the community to contribute. We'll need to flesh out those commands, and add some others to support common workflows in multi-container applications.

Branch: feature/support-multi-container-projects

How to get started:

  • Checkout the branch and pull changes
  • Install palm-cli from source with palm update --local
  • cd into a project with multiple containers, this will be the host project where you'll test things out.
  • run palm init --plugin multi_container
  • confirm that palm --help shows commands called up and down – if you see these, you're ready to go!

Remember, any changes in palm-cli have to be built before you'll see them in the CLI. palm update --local to build your changes. This can be a little slow and frustrating, especially when developing commands. To accelerate development you could palm scaffold command --name your_command to create it in the host project, then move it into the multi_container/commands directory once you're done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants