-
Notifications
You must be signed in to change notification settings - Fork 243
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
odo config support for settings in devfile.yaml #2688
Comments
Sorry if I do not understand this, but at the moment, we already store environment variable information in the Are you proposing that we should have a separate file outside of Ex of our current implementation: ~/openshift/nodejs-ex master ✗ 42d ⚑ ◒
▶ odo config set --env RAILS_ENV=development
✓ Environment variables were successfully updated
Run `odo push --config` command to apply changes to the cluster
~/openshift/nodejs-ex master ✗ 42d ⚑ ◒
▶ cat .odo/config.yaml
kind: LocalConfig
apiversion: odo.openshift.io/v1alpha1
ComponentSettings:
Type: nodejs
SourceLocation: ./
SourceType: local
Ports:
- 8080/TCP
Application: app
Project: testing
Name: nodejs-nodejs-ex-oguc
Envs:
- Name: RAILS_ENV
Value: development |
Yes, but only for devfile components. This is what Elson is proposing. I've added 4 more acceptance criteria that should make this clearer. But I'm not convinced that this is a good approach. @elsony Do you think that it makes sense to store env variables in the environment-specific config file? Shouldn't be all env variables captured in devfile.yaml? The way I see it |
I don't think we should store any true environment specific config in the devfile.yaml. It will make the devfile not portable and users can't check that into team repository. Having said that, there are some env setting that fits into the devfile, e.g. a devfile writer can have some containers rely on some env variable to change the behaviour of the build. Strictly speaking, that's part of the stack design and they are not really environment specific so those can be checked into the team repo and put as part of the devfile. However, for the real env specific that we currently put under the env.yaml, e.g. ingress domain, target namespace for odo push, etc., those are not portable to other system and we don't expect people to check it into the team repo. Therefore, the main difference between devfile.yaml and env.yaml are whether those config are environment neutral that can be reused in other systems. Regarding to the concerns on |
Agreed, ingress domain, namespace are good examples of environment-specific configs. But environment variables are not environment-specific. Env variables are highly specific to a given application, they should be part of the application configuration, and as such, it should be captured in devfile.yaml, most of the application depend on the right env variables being set.
Agreed, devfile is much more complex and powerful than Originally odo was designed in a way that users shouldn't need to edit any yaml files. And allow users to slowly build their application in an interactive way. This made it appealing to a lot of people. |
Hi @elsony I've assigned this to you. I think you've already implemented some of the user stories / criteria for this? Could you go through and see what could be checkmarked off? EDIT: I will pick this up 👍 |
Alright, I've started work on this, here's my TODO list (for my own reference too): When experimental mode is enabled, the following must happen against
Other scenarios:
Branch: https://github.com/cdrage/odo/tree/implement-env-setting-devfile |
so is any of the AC actually completed @cdrage? |
I think that Currently, odo supports the following parameters
With the old-style components (s2i) we have only one place to store configuration ( But with devfile components, we actually have two places where the config values can be stored I'm not so sure that just storing env variables set by |
As part of the devfile 2.0 spec (devfile/api#61), we are going to support |
@kadel What is the expectation for |
The remote port should be still determined by The idea is that the environment variable will make it easy to configure port in debug command. schemaVersion: 2.0.0
metadata:
name: nodejs
components:
- container:
name: nodejs
image: nodejs
mountSources: true
env:
- name: DEBUG_PORT
value: 1234
commands:
- exec:
id: debug
component: runtime
commandLine: nodemon --inspect 127.0.0.1:${DEBUG_PORT}
group:
kind: debug
isDefault: true |
This needs to be well documented somewhere for users making the transition from s2i components. |
OK, so |
@girishramnani This issue is still labeled as "needs-information". Is there something that is still needed? |
I would have a PR for review in a day. Quite close to getting it done. 1 small thing that I have already done but just wanted to confirm - can someone have a devfile which isn't called |
Also |
User Story
As a developer, I want to configure my configuration settings of devfile style components in the devfile.yaml so that I can change the settings after the initial creation.
Background
The storing of the configuration settings for the devfile style components is currently stored in the
devfile.yaml
that follows the devfile specification. However, the user currently cannot edit the settings in using the command line after the devfile in the project has been created as part of other commands.Acceptance Criteria
for "LocalConfig" components (s2i)
odo config
should work as currently doesfor devfile components
odo config
odo config
is doing all operations ondevfile.yaml
, should not touch any other file.Devfile can have multiple containers defined.
odo config
should by default apply the configuration to all containers in devfile.odo config set Name
- setmetadata.name
field i in devfile.yamlodo config set --env FOO=bar
- addFOO
env variable withbar
value to all containers defined in devfileodo config set Ports 8080/TCP
- add new endpoint to each container in devfileodo config set Memory
- setmemoryLimit
for all containers in devfile.yamlodo config unset/view
should work with new and updated fieldsodo confg
should have new updated description to match its meaning in devfile specodo config set DebugPort
- we can remove this option it in favor ofodo config set --env DEBUG_PORT=12345
odo config set MaxCPU
- remove this command - devfile v2 currently doesn't have cpu limitsodo config set MaxMemory
- remove this command - devfile v2 currently have only memory limitodo config set CPU
- remove this command - devfile v2 currently doesn't have cpu limitsodo config set MinCPU
- remove this command - devfile v2 currently doesn't have cpu limitsodo config set MinMemory
- remove this command - devfile v2 currently have only memory limitodo config set Ref
- remove this command - not valid for devfileodo config set SourceType
- remove this command - not valid for devfileodo config set Type
- remove this command - not valid for devfileodo config set SourceLocation
- remove this command - not valid for devfileThe devfile reference
Links
/kind user-story
/area devfile
The text was updated successfully, but these errors were encountered: