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

Install dev requirements in stylechecker #109

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

JelteF
Copy link
Contributor

@JelteF JelteF commented Feb 8, 2023

Needed to check Python formatting and linting from CI for citusdata/citus#6700

Since some of these tools need a somewhat recent python version this also required an update of the alpine base image. And to make that in turn work, we need to install uncrustify from source (just like we recommend devs to do).

@JelteF JelteF force-pushed the dev-requirements-in-stylechecker branch 3 times, most recently from 4a58d9a to 46b024e Compare February 8, 2023 13:23
@JelteF JelteF requested a review from hanefi February 8, 2023 16:36
Copy link
Member

@hanefi hanefi left a comment

Choose a reason for hiding this comment

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

Currently, the changes work as intended. However, there is a minor comment that can decrease the final docker image size even more.

You can ignore that comment if you feel like it is not worth the effort to over-engineer this change.

Comment on lines 5 to 25
RUN apk add --no-cache --virtual installdeps \
curl \
make \
cmake \
gcc \
g++ \
musl-dev \
python3-dev \
&& apk add --no-cache \
ca-certificates \
cmake \
bash \
git \
grep \
gzip \
musl-dev \
openssh \
perl \
python3 \
py3-pip \
tar \
Copy link
Member

Choose a reason for hiding this comment

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

I really like the effort to delete all install dependencies and leave only the packages that will be used in the package. However, I do not really get how and why some of the packages that are not listed under the virtual installdeps are used in the actual image. For example can we move the following to installdeps virtual package:

  • cmake appears to be used only when building uncrustify
  • gzip is used when extracting uncrustify tarball
  • musl-dev is a standard C library. I do not really know why we need it at all
  • openssh does not look like used at all as we use https connections for github and I do not see any other place that can actually use ssh.
  • py3-pip is used only here to install packages. Is it not safe to delete it after we are done with installing python packages? Deleting this package may also delete the python packages, so I am not sure if it is safe to move it to virtual package list at all.
  • tar is used when extracting uncrustify tarball.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved all of these packages to installdeps. Two callouts:

  1. I added py3-packaging to regular installed packages. Since py3-pip pulled that in and it's needed to run our linters due to pyproject.toml.
  2. musl-dev is needed during build because some python packages need it to compile some C stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay added back openssh. It's necessary for circleci to check out the github repo.

@JelteF JelteF force-pushed the dev-requirements-in-stylechecker branch 2 times, most recently from a8b1f56 to 1fd7bde Compare February 9, 2023 10:05
Needed to check Python formatting and linting from CI for citusdata/citus#6700
@JelteF JelteF force-pushed the dev-requirements-in-stylechecker branch from 1fd7bde to 6139186 Compare February 9, 2023 10:06
@JelteF JelteF merged commit 9a494cd into master Feb 9, 2023
@JelteF JelteF deleted the dev-requirements-in-stylechecker branch February 9, 2023 10:33
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.

2 participants