-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Theia docker file with launcher script #8732
Conversation
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
…ible to avoid building it if no plugins are requested from user
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
@@ -0,0 +1,20 @@ | |||
FROM node:8-alpine |
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.
could you add Copyright headers .
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.
Done
dockerfiles/theia/Dockerfile
Outdated
WORKDIR /home/theia | ||
# build Theia with all extensions to persist yarn cache in the image and | ||
# have default Theia build in the workspace in case no plugins are requested | ||
ADD theia-full-package.json /home/theia/package.json |
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 looks like there is a fork of upstream package.json, how to be in sync with upstream changes automatically ?
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 we can have two options here:
- curl original Theia package.json as a Dockerfile instruction
- Rely on our CI to do this after a triggered webhook.
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.
having the github URL of theia package.json will allow to only re-run the RUN instruction only if the remote side is updated
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.
(so we can reuse layer cache if there is no remote change)
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
"devDependencies": { | ||
"@theia/cli": "latest" | ||
} | ||
} |
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.
could you please add missing eof line
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.
done
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
dockerfiles/theia/Dockerfile
Outdated
EXPOSE 3000 | ||
ENV USE_LOCAL_GIT=true \ | ||
GITHUB_TOKEN=957257352ad57b7853c8b8714d2201bf4d337b5e | ||
# ENV THEIA_PLUGINS=[\"@theia\/extension-manager\",\"\@theia\/python\"] |
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.
should we remove this comment ?
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 leave it for testing purpose, but we also can use -e THEIA_PLUGINS=...
for this, so I remove it
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.
@evidolob you may add a README or in the header of Dockerfile on how to use that image
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
dockerfiles/theia/Dockerfile
Outdated
yarn theia build | ||
EXPOSE 3000 | ||
ENV USE_LOCAL_GIT=true \ | ||
GITHUB_TOKEN=957257352ad57b7853c8b8714d2201bf4d337b5e |
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 do not think that this is a good idea to put someone's token in dockerfile, I think it user should pass it's own GH token if that is necessary
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.
yes
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.
Sure it's not good. But at this point we don't have any way to get user's token
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.
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.
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.
@l0rd how does that help? The scenario is as follows:
- Theia image starts, we have a running container
- A node script checks for Theia plugins env and once found runs
yarn
andyarn theia build
against a generated or existing package.json. It is during this build that a token is required.
Maybe I don't understand smth about env replacement.
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.
@eivantsov sorry I meant https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e-env-env-file
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.
@eivantsov we don't need to get token, user should pass it
if you need token in runtime just pass it with docker run -e GITHUB_TOKEN=
, if you need token for docker build
you can do
+ARG GITHUB_TOKEN
+ENV GITHUB_TOKEN ${GITHUB_TOKEN}
docker build --build-arg GITHUB_TOKEN=<token>
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.
A user will just launch a workspace. It is us who do docker run, Che server I mean.
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.
ahh, I thought it is image for CI, because all images we have in dockerfiles/
are for CLI and they are supposed to be built on CI. if that is image for WS maybe it should be moved to github.com/eclipse/che-dockerfiles ?
based on demo, could it be possible to give
instead of
|
@benoitf it was just easier to parse it :) Format and delivery method for plugins list is to be further discussed. |
@eivantsov but humans are not good parsers :-) |
Easier for node script. So, we agreed to start with |
@benoitf We never consider that user will manually edit that property, we should get good UI in dashboard for that |
|
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
Now plugin list should provided as @benoitf proposed. |
Even though this is a stack image, we will probably need it to be versioned and updated on a regular basis. |
By the way @eivantsov it would be nice if all Che runtime stacks images could be versioned too. But that's another story :-) |
* eclipse-che#8701 create launcher for theia Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
What does this PR do?
add Docker file with Theia and launcher script that can rebuild Theia with provided set of the plugin.
What issues does this PR fix or reference?
#8701
Release Notes
Docs PR