Skip to content
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

fix: #20880 instead of a separate stage for... #534

Merged
merged 1 commit into from
Dec 3, 2021

Conversation

nickboldt
Copy link
Contributor

@nickboldt nickboldt commented Dec 3, 2021

What does this PR do?

fix: #20880 instead of a separate stage for dwtemplates, just use the node16 image as the builder, and then we don't have to repeat the same several steps in a new container... and don't have to fix perms in /devfiles/ folder either

Added bonuses to this fix:

  • updateBaseImages can be run for ubi8/nodejs-16-minimal to keep it current (instead of the outdated ubi8-minimal:8.4, which should be on 8.5 now)
  • downstreaming doesn't require new logic for dealing with the dwtemplates stage (downstream can't do several multipel stages, only 2 (build, runtime).

Change-Id: Ib61cfe1548e73ed2a8225596088250248b907c50
Signed-off-by: nickboldt nboldt@redhat.com

Screenshot/screencast of this PR

N/A

What issues does this PR fix or reference?

eclipse-che/che#20880

How to test this PR?

N/A

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

… node16 image as the builder, and then we don't have to repeat the same several steps in a new container... and don't have to fix perms in /devfiles/ folder either

Change-Id: Ib61cfe1548e73ed2a8225596088250248b907c50
Signed-off-by: nickboldt <nboldt@redhat.com>
@github-actions
Copy link

github-actions bot commented Dec 3, 2021

Click here to review and test in web IDE: Contribute

RUN chmod -R g+rwX /build/devfiles

FROM docker.io/node:16.13.0-alpine3.14 as dwtemplates
COPY ./build/scripts /build/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these three lines are dupes of work being done higher up, so if we start with node:16.13.0-alpine3.14 instead of outdated alpine:3.11.5, we don't need a second stage here.

RUN ./generate_devworkspace_templates.sh
RUN chmod -R g+rwX /build/devfiles
Copy link
Contributor Author

Choose a reason for hiding this comment

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

permission problem seen in eclipse-che/che#20880 could be caused by running ./generate_devworkspace_templates.sh AFTER fixing group permissions in /build/devfiles

RUN chmod -R g+rwX /build/devfiles


FROM registry.access.redhat.com/ubi8/nodejs-16-minimal:1-6 as dwtemplates
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this orphaned layer won't ever be updated with updateBaseImages because there's no associated RHEC URL from which to search for new tags



FROM registry.access.redhat.com/ubi8/nodejs-16-minimal:1-6 as dwtemplates
USER 0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the next 4 lines are already done in the builder stage, so by using node16-mini image, as builder, we don't need a second stage here with 4 duplicate steps.

@nickboldt
Copy link
Contributor Author

7.40.0 image contains a number of non-group-writeable folders, unlike in 7.39.0.

$➔ podman run -it --rm --entrypoint /bin/bash quay.io/eclipse/che-devfile-registry:7.40.0 -c "ls -la /var/www/html/devfiles/ | grep -E -v 'drwxrwx|-rw-rw-r--'"

total 152
drwxr-xr-x  2 root root  4096 Dec  2 22:23 bash
drwxr-xr-x  2 root root  4096 Dec  2 22:23 cpp
drwxr-xr-x  2 root root  4096 Dec  2 22:23 dotnet-asp.net
drwxr-xr-x  2 root root  4096 Dec  2 22:23 go
drwxr-xr-x  2 root root  4096 Dec  2 22:23 java-lombok
drwxr-xr-x  2 root root  4096 Dec  2 22:23 java-mongo
drwxr-xr-x  2 root root  4096 Dec  2 22:23 java-web-spring
drwxr-xr-x  2 root root  4096 Dec  2 22:24 nodejs
drwxr-xr-x  2 root root  4096 Dec  2 22:23 nodejs-angular
drwxr-xr-x  2 root root  4096 Dec  2 22:24 nodejs-mongo
drwxr-xr-x  2 root root  4096 Dec  2 22:24 nodejs-react
drwxr-xr-x  2 root root  4096 Dec  2 22:24 nodejs-yarn
drwxr-xr-x  2 root root  4096 Dec  2 22:24 php-symfony
drwxr-xr-x  2 root root  4096 Dec  2 22:24 python
drwxr-xr-x  2 root root  4096 Dec  2 22:24 python-django
drwxr-xr-x  2 root root  4096 Dec  2 22:24 quarkus
drwxr-xr-x  2 root root  4096 Dec  2 22:24 scala-sbt

Once I have it built, I'll post the equivalent check for my updated 7.40.0 build.

@nickboldt
Copy link
Contributor Author

nickboldt commented Dec 3, 2021

Built locally, and copied to quay as https://quay.io/repository/eclipse/che-devfile-registry?tag=PR534&tab=tags

$➔ podman run -it --rm --entrypoint /bin/bash bc420822822f06425b020196aee4dbf3cc3dc6fdea1639b12c6a8655b1c34ed3 -c "ls -la /var/www/html/devfiles/"

total 152
drwxrwxrwx 32 root root  4096 Dec  3 19:06 .
drwxrwxr-x  5 root root  4096 Dec  3 19:06 ..
-rw-rw-r--  1 root root    26 Jan 13  2020 .htaccess
drwxrwx---  2 root root  4096 Dec  3 19:05 apache-camel-k
drwxrwx---  2 root root  4096 Dec  3 19:06 apache-camel-springboot
drwxrwxr-x  2 root root  4096 Dec  3 19:06 bash
drwxrwx---  2 root root  4096 Dec  3 18:28 che4z
drwxrwx---  2 root root  4096 Dec  3 19:05 cpp
drwxrwx---  2 root root  4096 Dec  3 19:06 dotnet
drwxrwx---  2 root root  4096 Dec  3 19:05 dotnet-asp.net
-rw-rw-r--  1 root root  1050 Dec  3 18:28 external_images.txt
drwxrwx---  2 root root  4096 Dec  3 19:06 go
-rw-rw-r--  1 root root 15174 Dec  3 18:28 index.json
drwxrwx---  2 root root  4096 Dec  3 19:06 java-gradle
drwxrwxr-x  2 root root  4096 Dec  3 19:06 java-lombok
drwxrwx---  2 root root  4096 Dec  3 19:05 java-maven
drwxrwx---  2 root root  4096 Dec  3 19:06 java-mongo
drwxrwx---  2 root root  4096 Dec  3 19:05 java-mysql
drwxrwx---  2 root root  4096 Dec  3 19:05 java-web-spring
drwxrwx---  2 root root  4096 Dec  3 19:06 java-web-vertx
drwxrwx---  2 root root  4096 Dec  3 19:06 nodejs
drwxrwxr-x  2 root root  4096 Dec  3 19:06 nodejs-angular
drwxrwx---  2 root root  4096 Dec  3 19:06 nodejs-mongo
drwxrwx---  2 root root  4096 Dec  3 19:06 nodejs-react
drwxrwx---  2 root root  4096 Dec  3 19:06 nodejs-yarn
drwxrwx---  2 root root  4096 Dec  3 19:06 php-laravel
drwxrwx---  2 root root  4096 Dec  3 19:06 php-mysql
drwxrwx---  2 root root  4096 Dec  3 19:06 php-symfony
drwxrwx---  2 root root  4096 Dec  3 19:05 php-web-simple
drwxrwx---  2 root root  4096 Dec  3 19:05 python
drwxrwx---  2 root root  4096 Dec  3 19:06 python-django
drwxrwxr-x  2 root root  4096 Dec  3 19:05 quarkus
drwxrwxr-x  2 root root  4096 Dec  3 19:06 quarkus-command-mode
drwxrwx---  2 root root  4096 Dec  3 19:06 rust
drwxrwxr-x  2 root root  4096 Dec  3 19:06 scala-sbt

permissions now look the same as they did for 7.39.0

@nickboldt nickboldt merged commit 2201fe0 into main Dec 3, 2021
@nickboldt nickboldt deleted the gh20880-fix-perms-and-combine-stages branch December 3, 2021 21:35
@che-bot che-bot added this to the 7.41 milestone Dec 3, 2021
svor pushed a commit that referenced this pull request Dec 4, 2021
* fix: output of meta.yaml should be yaml content

Change-Id: Idcbe30c9f1c8ee1f0b0162a3061ee9210dd4d4cb
Signed-off-by: Florent Benoit <fbenoit@redhat.com>

* [release] Bump to 7.41.0-SNAPSHOT in main (#528)

Signed-off-by: Mykhailo Kuznietsov <mkuznets@redhat.com>

Co-authored-by: Mykhailo Kuznietsov <mkuznets@redhat.com>

* chore(digests): update dockerfile base images

Signed-off-by: Mykhailo Kuznietsov <mkuznets@redhat.com>

* chore(sidecars): bump to new sidecar tags

Signed-off-by: Mykhailo Kuznietsov <mkuznets@redhat.com>

* fix: better recovery from a failed skopeo... (#529)

* fix: better recovery from a failed skopeo inspect -- try again and if not resolved after 2 attempts, DON'T CHANGE the digest to a nullstring

Change-Id: Ic65d99256542b646eb7f3e64f404f40071edab72
Signed-off-by: nickboldt <nboldt@redhat.com>

* chore: include newer digest in this PR so we can simply merge this and close #526

Change-Id: I11a9933f515fcd7a9fafa3c62608b771d92e50ef
Signed-off-by: nickboldt <nboldt@redhat.com>

* fix: #20880 instead of a separate stage for dwtemplates, just use the node16 image as the builder, and then we don't have to repeat the same several steps in a new container... and don't have to fix perms in /devfiles/ folder either (#534)

Change-Id: Ib61cfe1548e73ed2a8225596088250248b907c50
Signed-off-by: nickboldt <nboldt@redhat.com>

* [release] Bump to 7.40.0 in 7.40.x

Signed-off-by: Mykhailo Kuznietsov <mkuznets@redhat.com>

Co-authored-by: Florent Benoit <fbenoit@redhat.com>
Co-authored-by: Mykhailo Kuznietsov <mkuznets@redhat.com>
Co-authored-by: Nick Boldt <nboldt@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to start quay.io/eclipse/che-devfile-registry:7.40.0 on OpenShift after update from 7.39.0
3 participants