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

Blake nedved rework docker building #916

Merged
merged 28 commits into from
Jan 4, 2024

Conversation

JoshuaSBrown
Copy link
Collaborator

@JoshuaSBrown JoshuaSBrown commented Oct 30, 2023

Description

This pull request includes changes that will simplify the docker build process and make it significantly faster and produce smaller images on average by better utilizing the docker cache, to do this the dockerfiles have be reorganized so that they all pull from one dependencies image and one runtime image so that way the dependencies only need to be built once.

Tasks

  • - Upgrade version
  • - Changelog comment
  • - Add tests
  • - Feature description
  • - Working tests in ci
  • - Formatting passes
  • - Documentation added
  • - Add labels
  • - Assign work
  • - Assign expected time

Work time

Expected time: 3 weeks

@JoshuaSBrown JoshuaSBrown marked this pull request as draft October 30, 2023 17:05
.gitlab-ci.yml Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@JoshuaSBrown JoshuaSBrown left a comment

Choose a reason for hiding this comment

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

All files that need to be accessed by the user during docker run should be made accessible to the root group. This is a requirement of running with OpenShift.

Also, to encourage a decoupled design, let's split the single docker file into components that go in the respective web/ repo core etc... folders.

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
core.Dockerfile Outdated Show resolved Hide resolved
build-base.Dockerfile Outdated Show resolved Hide resolved
@JoshuaSBrown JoshuaSBrown added Priority: High Highest priority Component: Web UI Relates to web appp user interface Component: Core Relates to core service Component: Repository Relates to repository service Component: Build Related to the build system labels Dec 2, 2023
@JoshuaSBrown
Copy link
Collaborator Author

JoshuaSBrown commented Dec 21, 2023

Something on the permissions of the web server are still off. Looks like the NVM posix permissions are not being handled correctly.

 => ERROR [ws 13/15] RUN . /datafed/scripts/dependency_versions.sh &&      . /datafed/.nvm/nvm.sh &&        npm --allow-root --unsafe-perm --prefix /opt/datafed/web install                                                                                                                                     0.2s
------
 > [ws 13/15] RUN . /datafed/scripts/dependency_versions.sh &&                                          . /datafed/.nvm/nvm.sh &&                                                               npm --allow-root --unsafe-perm --prefix /opt/datafed/web install:
0.170 /bin/sh: 1: .: Can't open /datafed/.nvm/nvm.sh
------
Dockerfile:91
--------------------
  90 |     COPY --from=ws-build --chown=datafed:root ${BUILD_DIR}/web/package.json ${DATAFED_INSTALL_PATH}/web/package.json
  91 | >>> RUN . ${DATAFED_DIR}/scripts/dependency_versions.sh &&                                       \
  92 | >>>      . ${DATAFED_DIR}/.nvm/nvm.sh &&                                                 \
  93 | >>>      npm --allow-root --unsafe-perm --prefix ${DATAFED_INSTALL_PATH}/web install
  94 |
--------------------

@nedvedba nedvedba marked this pull request as ready for review January 2, 2024 19:17
@JoshuaSBrown JoshuaSBrown merged commit a7529e6 into devel Jan 4, 2024
3 of 5 checks passed
@JoshuaSBrown JoshuaSBrown deleted the BlakeNedved-rework-docker-building branch August 29, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Build Related to the build system Component: Core Relates to core service Component: Repository Relates to repository service Component: Web UI Relates to web appp user interface Priority: High Highest priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants