Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Build che-theia plugins from che-theia-dev builder container rather than getting it from released travis built #43

Merged
merged 3 commits into from
Mar 1, 2019

Conversation

sunix
Copy link
Contributor

@sunix sunix commented Jan 31, 2019

It is a proposal, WDYT ?

Signed-off-by: Sun Seng David TAN sutan@redhat.com

@sunix sunix changed the title Build plugins from che-theia-dev builder image rather than getting it from released travis built Build che-theia plugins from che-theia-dev builder image rather than getting it from released travis built Jan 31, 2019
@sunix sunix changed the title Build che-theia plugins from che-theia-dev builder image rather than getting it from released travis built Build che-theia plugins from che-theia-dev builder container rather than getting it from released travis built Jan 31, 2019
Copy link
Contributor

@evidolob evidolob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need a list of plugins that we add, as in this repository may exist plugins that we do not want do include in Docker image by default

@@ -70,6 +73,13 @@ RUN che:theia production
# change permissions
RUN find production -exec sh -c "chgrp 0 {}; chmod g+rwX {}" \; 2>log.txt

# Clone and build che-theia plugins
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make it part of the theia-generator (the clone will be done in init step)

and then the compilation would occurs as another step of theia-generator like 'build-plugins' or something else

Then it will use same flag that @evidolob is adding for dev mode (master branch) vs tagged version, etc

@@ -70,6 +73,13 @@ RUN che:theia production
# change permissions
RUN find production -exec sh -c "chgrp 0 {}; chmod g+rwX {}" \; 2>log.txt

# Clone and build che-theia plugins
RUN git clone --branch ${CHE_THEIA_PLUGIN_BRANCH} --single-branch --depth 1 https://github.com/eclipse/che-theia ${HOME}/che-theia-source-code
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not add these steps after the changes of permission

besides I'm in favor of adding it to che-theia-generator, I think that the plug-ins should not be compiled in the same image
It should be part of another stage. So if you modify theia but not plug-ins we may benefit of docker cache ?

…leased ones

Signed-off-by: Sun Seng David TAN <sutan@redhat.com>
@sunix sunix force-pushed the build_plugins_in_che-theia-dev branch from 1369f39 to 2278419 Compare February 27, 2019 17:49
@sunix
Copy link
Contributor Author

sunix commented Feb 27, 2019

@benoitf and @evidolob could you review ?
This is temporary:
I will then work on the generator to have plugins in it.

RUN yarn

RUN mkdir -p ${HOME}/che-theia-plugins/ && \
find ${HOME}/che-theia-source-code/plugins/ -name "*.theia" -exec sh -c "chgrp 0 {}; chmod g+rwX {}; cp {} ${HOME}/che-theia-plugins/" \; 2>log.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now it should contain a regexp to only select a subset of plug-ins

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure also why we do chgrp/chmod there

Copy link
Contributor Author

@sunix sunix Feb 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now it should contain a regexp to only select a subset of plug-ins

ok which ones do we keep ? @l0rd @evidolob @benoitf

  • containers-plugin
  • factory-plugin
  • ports-plugin
  • ssh-plugin
  • welcome-plugin

I'm not sure also why we do chgrp/chmod there

not sure I thought we had a good reason as we do it for theia production package

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, we do the chgrp/chmod for this folder later in production container so we don't need to do it in the build container

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok i see :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benoitf added the right filter and removed the permission change commands

@@ -96,6 +136,8 @@ ENV USE_LOCAL_GIT=true \

EXPOSE 3100 3130

COPY --from=plugins-builder /home/theia-dev/che-theia-plugins /default-theia-plugins
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--chown=theia:root ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

permissions are updated afterwards for /default-theia-plugins
and group or user doesn't exist yet.

…ting released ones

Signed-off-by: Sun Seng David TAN <sutan@redhat.com>
…han getting released ones

Signed-off-by: Sun Seng David TAN <sutan@redhat.com>
@sunix
Copy link
Contributor Author

sunix commented Feb 28, 2019

selection_187

@@ -82,6 +82,46 @@ RUN che:theia production
# change permissions
RUN find production -exec sh -c "chgrp 0 {}; chmod g+rwX {}" \; 2>log.txt


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello, didn't see it before.

why do we have copy of lines 89--->115 from the previous container ?
couldn't we just add # Clone and build che-theia plugins at the end of previous container ?

here we're duplicating all github token, etc logic in the same file for almost nothing ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe i misunderstood the comments of #43 (comment)
we are duplicating just the github token stuff. I am very fine with cloning and building che-theia plugins at the end of the previous container

fi

# Clone and build che-theia plugins
RUN git clone --branch ${CHE_THEIA_PLUGIN_BRANCH} --single-branch --depth 1 https://github.com/eclipse/che-theia ${HOME}/che-theia-source-code
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks odd to clone CHE_THEIA while we're inside che-theia there, no ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, on another hand this is what we do with the generator

@sunix sunix merged commit b9ab733 into master Mar 1, 2019
@sleshchenko sleshchenko deleted the build_plugins_in_che-theia-dev branch February 26, 2020 10:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants