-
Notifications
You must be signed in to change notification settings - Fork 63
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
Stack vs sample proposal and outer loop proposal #492
Conversation
Signed-off-by: eyuen <eyuen@redhat.com>
Signed-off-by: eyuen <eyuen@redhat.com>
Signed-off-by: eyuen <eyuen@redhat.com>
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 concerned we're providing too many options at once and overloading our definitions. It looks like the image
component type has a lot of fields that have specific use cases, which may be hard to use/document.
From what I can tell, the full spec for image
components is the below
image:
imageName: {{myimage}}
# Exclusive of s2i type
dockerfile:
# Common fields
args: [ "arg1", "arg2", "arg3" ]
envFrom:
- secretRef:
name: my-secret
# Option 1
buildContext: ${PROJECTS_ROOT}/build
location: Dockerfile
rootRequired: false
# Option 2
id: mycompany/my-node-stack-dockerfile/v2.2.2
# Option 3
git:
remotes:
origin: "https://github.com/odo-devfiles/nodejs-ex.git"
location: Dockerfile
# Exclusive of dockerfile type
s2i:
builderImageNamespace: mynamespace
builderImageStreamTag: mytag
scriptLocation:
remotes:
origin: "https://github.com/odo-devfiles/nodejs-ex.git"
We would need a very complicated set of validations here, e.g. it's either dockerfile
or s2i
, then if it's dockerfile, it's either {buildContext, location, rootRequired}
, {id}
, or {git, location}
- Input\ | ||
The build may use different technologies for building, e.g. dockerfile, buildpacks | ||
- Output:\ | ||
A container image that contains the microservice and ready to be deployed to Kubernetes |
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 think this is more readable on single lines
- **Input**: The build may use different technologies for building, e.g. dockerfile, buildpacks
- **Output**: A container image that contains the microservice and ready to be deployed to Kubernetes
Also, - Input
is missing a colon.
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 find using it more readable using separate lines so I keep the separate lines. I've added the missing colon.
|
||
We will cover two main stages: | ||
1. Build the image | ||
2. Deployment of the image. Deploy the image to a cluster |
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.
2. Deployment of the image. Deploy the image to a cluster | |
2. Deploy the image to a cluster |
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.
Fixed
### Example using `apply` command on an image component: | ||
commands: | ||
- id: deploybuild | ||
apply: | ||
component: mydockerfileimage |
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 not sure I understand the purpose of the apply
command here.
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.
See the note section. It is used for controlling the image startup.
dockerfile: | ||
id: mycompany/my-node-stack-dockerfile/v2.2.2 | ||
args: [ ] |
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 don't understand what this refers to. What is this an id
into?
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's for referring to a resource within the registry.
git: | ||
remotes: | ||
origin: "https://github.com/odo-devfiles/nodejs-ex.git" | ||
location: Dockerfile | ||
args: [ ] |
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.
We're really overloading .image.dockerfile
with multiple disjoint sets of fields. This might be hard to use/understand.
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 PR is supposed to convert the existing design proposal spec so that everyone has access. If there are suggestions on spec changes, please open a separate item to discuss.
The git definition will be the same as the one in `starterProjects` definition that supports `checkoutFrom` | ||
|
||
`location`: the location of the dockerfile within the repo. If `checkoutFrom` is being used, the location will be relative to the root of the resources after cloning the resources using the `checkoutFrom` setting. |
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.
If we're using a lot of logic from projects
, why don't we just use projects for this? If you have the section above as a project in your devfile, you should just be able to use the first case (dockerfile + buildContext, etc.)
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.
We are only reusing the location definition, e.g. git and zip, of a project. Project has special meaning for defining and it is incorrect to retry to replace the dockerfile component with the project component.
1. Operators | ||
1. Helm | ||
|
||
The initial design will focus on the first two items for discussion. Other ways of building the image will be covered later. |
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.
These items may need to be reordered -- it looks like the proposal below covers deployment manifest and helm.
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.
Reordered the example to match.
|
||
## Overview | ||
|
||
The existing devfile registry focuses on the stack support to provide generic language/framework/runtime, e.g. Node, Java maven, Quarkus, etc., support to build and run user applications. These devfiles are called ***stack devfiles***. There is another kind of devfile in a devfile registry that is tailored for a building and running a specific application. These devfiles are referred to as ___*sample devfiles*___ (example: https://github.com/redhat-developer/devfile-sample). |
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.
For consistency, we should use either ***text***
or ___*text*___
for bold-italics.
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.
Fixed
variables: | ||
myimage: myimagename | ||
components: | ||
- name: mydockerfileimage | ||
image: | ||
imageName: {{myimage}} | ||
dockerfile: | ||
buildContext: ${PROJECTS_ROOT}/build | ||
location: Dockerfile | ||
args: [ "arg1", "arg2", "arg3" ] | ||
rootRequired: false |
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.
Use regular code blocks to get syntax highlighting.
variables: | |
myimage: myimagename | |
components: | |
- name: mydockerfileimage | |
image: | |
imageName: {{myimage}} | |
dockerfile: | |
buildContext: ${PROJECTS_ROOT}/build | |
location: Dockerfile | |
args: [ "arg1", "arg2", "arg3" ] | |
rootRequired: false | |
```yaml | |
variables: | |
myimage: myimagename | |
components: | |
- name: mydockerfileimage | |
image: | |
imageName: {{myimage}} | |
dockerfile: | |
buildContext: ${PROJECTS_ROOT}/build | |
location: Dockerfile | |
args: [ "arg1", "arg2", "arg3" ] | |
rootRequired: false |
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.
fixed
variables: | ||
myimage: myimagename | ||
components: | ||
- name: mydockerfileimage | ||
image: | ||
imageName: {{myimage}} | ||
dockerfile: | ||
buildContext: ${PROJECTS_ROOT}/build | ||
location: https://github.com/redhat-developer/devfile-sample/blob/master/src/Dockerfile | ||
args: [ "arg1", "arg2", "arg3" ] | ||
rootRequired: false | ||
envFrom: | ||
- secretRef: | ||
name: my-secret |
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.
Enclose in ```yaml (....) ```
Applies to other code blocks in this document as well.
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.
fixed all
Signed-off-by: eyuen <eyuen@redhat.com>
@amisevsk This PR is supposed to just put the existing design proposal spec in the repo so that everyone has access. The specification has been gone through a couple of rounds of discussions in the cabal call. Therefore, I am only addressing formatting issues in this PR. If there are suggestions on spec changes, please open a separate item to discuss and bring it up to the cabal call for spec change discussion. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: amisevsk, elsony, GeekArthur The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: eyuen eyuen@redhat.com
What does this PR do?
Move design doc from gdoc (https://docs.google.com/document/d/1tbzZK9aWtpw5AtoZmUl1Jy8x8w9N5hhjXu3c26VYiYY/edit?usp=sharing and https://docs.google.com/document/d/1SL3ZJyAy8lp973EzQpY36VjTJHoyGXl2zUXokPiXwK8/edit?usp=sharing) to design doc in repo for public access.
What issues does this PR fix or reference?
Design doc for #279 and #51
Is your PR tested? Consider putting some instruction how to test your changes
Design doc changes only
Docs PR
Design doc changes only
Note: I accidentally closed the original PR #474 so this new one replaces it with all the review comments addressed.