-
Notifications
You must be signed in to change notification settings - Fork 244
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
control over how rsync and start/stop happens #3132
Comments
I can see two options for how this be done in odo. Special Devfile that supports local build.This would be devfile that doesn't define any build commands. example of a devfile.yaml without buildschemaVersion: 2.0.0
metadata:
name: maven
version: 1.0.0
components:
- container:
name: tools
image: quay.io/eclipse/che-java11-maven:nightly
mountSources: true
commands:
- exec:
id: run
component: tools
commandLine: "java -jar target/*.jar"
group:
kind: run
isDefault: true The only problem that we need to solve here is that odo needs to know what are the build artifacts that need to be pushed to the container. Option to skip build step, with regular devfile.yamlnormal devfile.yaml with build and run commandsschemaVersion: 2.0.0
metadata:
name: maven
version: 1.0.0
components:
- container:
name: tools
image: quay.io/eclipse/che-java11-maven:nightly
mountSources: true
commands:
- exec:
id: devBuild
component: tools
commandLine: "mvn package"
group:
kind: build
isDefault: true
- exec:
id: run
component: tools
commandLine: "java -jar target/*.jar"
group:
kind: run
isDefault: true For |
why is it you would want the artifacts as part of the command line of odo and not as something defined in the devfile ? |
@kadel Is |
Yes devfile components do use |
We should also find a way to save the info in the env.yaml instead of using the |
Please update the issue as discussed on the triage call. @kadel |
Background - how to do remote dev with quarkusQuarkus has a remote development mode. In this mode Quarkus handles syncing and reloading on its own. Odo should let Quarkus handle it and don't interfere. To use Quarkus remote dev mode, you first need to add following lines to
Than you build the After transferring the On the local side (your laptop) you just need to execute How remote devmode worksThe local and remote are communicating bi-bidirectionally. My understanding of how this works:
All this is fast enough that it happens within the request time. How to do Quarkus dev mode in current odo (hacky and slow)It is already possible to write a devfile that will use Quarkus remote devmode. Problem is that with how odo currently works, this will be even slower than doing regular source push, rebuild, reload. To test this you:
schemaVersion: 2.0.0
metadata:
name: java-quarkus-remotedev
version: 1.1.0
website: https://quarkus.io
starterProjects:
- name: community
zip:
location: https://code.quarkus.io/d?e=io.quarkus%3Aquarkus-resteasy&e=io.quarkus%3Aquarkus-micrometer&e=io.quarkus%3Aquarkus-smallrye-health&e=io.quarkus%3Aquarkus-openshift&cn=devfile
- name: redhat-product
zip:
location: https://code.quarkus.redhat.com/d?e=io.quarkus%3Aquarkus-resteasy&e=io.quarkus%3Aquarkus-smallrye-health&e=io.quarkus%3Aquarkus-openshift
components:
- name: tools
container:
image: quay.io/eclipse/che-quarkus:nightly
memoryLimit: 1512Mi
mountSources: true
env:
- name: QUARKUS_LAUNCH_DEVMODE
value: "true"
volumeMounts:
- name: m2
path: /home/user/.m2
endpoints:
- name: '8080-http'
targetPort: 8080
- name: m2
volume:
size: 3Gi
commands:
- id: dev-run
attributes:
"dev.odo.push.path:target/quarkus-app/": "target/quarkus-app/"
exec:
component: tools
commandLine: "java -jar target/quarkus-app/quarkus-run.jar -Dquarkus.http.host=0.0.0.0"
hotReloadCapable: true
group:
kind: run
isDefault: true
workingDir: $PROJECTS_ROOT
- id: dev-debug
exec:
component: tools
commandLine: "java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=${DEBUG_PORT},suspend=n -jar target/quarkus-app/quarkus-run.jar -Dquarkus.http.host=0.0.0.0"
hotReloadCapable: true
group:
kind: debug
isDefault: true
workingDir: $PROJECTS_ROOT
How to better support remote dev flow in odoThere are two differences between Quarkus remote dev and regular odo flow.
The first item is already supported in odo. If there is no For the second item we need to be able to tell odo that only certain files should be pushed the container. You can see The format of this attribute is |
|
Can we also document the annotation and an example of how to do this entire thing on odo.dev? |
I think you would need more than just single file copying. also, are deletes handled ? like if a file is no longer there is the remote one removed ? |
Multiple remote attributes and folder based attributes will be supported but the syntax would be
Yes, deletion of files and removal of files upon removal of corresponding remote attributes will be supported. Here's the WIP PR #4588. All the scenarios can be tested against the current state of the PR and it only requires cleanup ad integration tests currently. |
But how do you specify the target dir? They won't necessarily match inside the container? |
The format of this attribute is dev.odo.push.file:: where
Yes the local path and the remote path might not match. |
Since we want to support both files and folder, the name of the attribute has been changed to |
/kind feature
Which functionality do you think we should add?
Being able to customize in devfile what folders are rsynced to not only support in-cluster source builds but be able to take locally built artifacts and put in a specific location on the deployment.
Why is this needed?
to support wildfly, tomcat, or any other runtime that supports true incremental hotdeploy of resources (wether source or binaries) (quarkus will support this in upcoming releases)
Advantages:
disadvantages:
The text was updated successfully, but these errors were encountered: