-
Notifications
You must be signed in to change notification settings - Fork 65
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
Inner loop dockerfile support #346
Comments
I think we should update the experience based on #51 Namely, instead of introducing a
|
@resios I agree. I have updated the description with the new proposal. |
@l0rd Thank you. We'll pick this up and use #580 as a stepping stone. Are you ok with adding Other alternatives:
|
@resios I am ok with |
@l0rd Will do. I'll add it to the agenda. |
Is there someone working on this? Or I can go and try to add this? (For sure after the discussion during the next cabal meeting) |
@AlexKhotian no, I don't think anyone is looking at it. Go ahead! cc @elsony |
To state my concern another way: The outer loop proposal suggests there's one lifecycle for kubernetes-typed components referenced via apply commands, relative to image type components, and a separate lifeycle for other kubernetes-typed components. Now this proposal implies there's going to be a different lifecycle for container-typed components relative to image-typed components. My concern is that this multi-component lifecycle isn't spelled out in detail and one place, making it hard to feel comfortable with enhancements like this. |
@scottkurz are you referring this? "The apply command with the image component is optional. If the apply command that references an image component does not exist, then the image build will be done at the startup automatically (similar to the behaviour of the existing kubernetes components). If there is an apply command that references the image component, then the user will need to create a composite command to chain the image build apply command with the deploy command (see the deployment command section) to complete the build and deploy." I agree that this is starting to get necessary complicated.
We should not try to complicate this even more. I actually think that with introduction of variables:
myimage: myregistry:5000/inerloop-image:latest
components:
- name: innerloop-image
image:
imageName: {{myimage}}
dockerfile:
location: Dockerfile
- name: runtime
container:
image: {{myimage}}
mountSources: true The above should theoretical already work (once tools have support for |
@kadel So you suggest to build components:
- name: innerloop-image
image:
imageName: test-image
dockerfile:
location: Dockerfile
- name: runtime
container:
image: test-image
mountSources: true |
@kadel @elsony @resios Would be great if we can conclude on the logic. There is an components:
- name: innerloop-image
image:
imageName: test-image
dockerfile:
uri: Dockerfile
- name: runtime
container:
image: test-image
mountSources: true Note: seems like there is no |
yes
Yes, but I don't think that given the rules for components we don't need any extra references. Also, the use of recently added variables helps reduce hardcoded value duplication. |
I see. components:
- name: service-image
image:
imageName: service:1.1
dockerfile:
uri: Dockerfile
- name: service-dev # no command - I just want to write code for my new service flavor here
container:
image: service:1.1
mountSources: true
- name: service-queue
container:
image: service:1.1
command: "./start-queue"
mountSources: true
- name: service-publisher
container:
image: service:1.1
command: "./start-queue"
mountSources: true Referencing seems to make it clear - what is a build time and what is a runtime. Wdyt? Note: I think this type of referencing already works with the changes from the outer-loop support. |
To me this makes sense.
If I'm not mistaken we already have rules around what component should be automatically created on startup. If component is not reference by any |
Correct, we have introduced api/pkg/apis/workspaces/v1alpha2/component_image.go Lines 40 to 45 in f6d7cd8
Tools can choose always to build images(with If I understands correctly, the innerloop scenarios requirements have been fulfilled by the design of current image component? Anything else left for this issue? |
One question I have for @AlexKhotian and @resios is if they expect that in the devfile registry samples like java spring boot basic: components:
- name: outerloop-build
image:
imageName: java-springboot-image:latest
dockerfile:
uri: docker/Dockerfile
buildContext: .
rootRequired: false
- name: outerloop-deploy
kubernetes:
uri: outerloop-deploy.yaml # ==> references java-springboot-image:latest we add an innerloop-deploy component too: components:
(...)
- name: innerloop-deploy
container:
image: java-springboot-image:latest # ==> reference to the image that would mean that we would have also some extra commands for "inner-loop" build-image: - id: run-container
apply:
component: innerloop-deploy
- id: deploy-container
composite:
commands:
- build-image
- deploy-container
group:
kind: deploy
isDefault: true I am asking to understand if the docker-plugin will be a client of the devfile registry samples or if it will have it's own samples/registry. |
The original requirement for devfile has already been implemented: #346 (comment). |
Devfile community call discussion: |
Is your feature request related to a problem? Please describe.
Currently it's possible to specify a container used in the inner loop (from within an IDE for example) referring it's image.
That requires that the image has been built and published somewhere. But projects often include a
Dockerfile
with build and runtime tools. The development flow in this case is usually:Dockerfile
to locally create an image with build and runtime toolsThere may be some variants to this flow, including:
Even if the flow may be different, for all those variants building and running an image from a Dockerfile (without publishing the image) is part of the inner loop.
Describe the solution you'd like
Specify a container component using a reference to an image component that exist in the same
Devfile
or in the parent:The text was updated successfully, but these errors were encountered: