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

Improve build script #109

Merged
merged 7 commits into from
Jun 26, 2024
Merged

Improve build script #109

merged 7 commits into from
Jun 26, 2024

Conversation

janhoy
Copy link
Contributor

@janhoy janhoy commented Jun 26, 2024

In #104 I moved the build.sh script from requiring a local python and pelican install, to using a docker image locally.

The script has some weaknesses and bugs.

  • The chained commands pip and pelican were not passed correctly to docker runtime, causing error
    ./build.sh: line 64: pelican: command not found
  • The requirements needed to be pulled every single time

This PR addresses this

  • On first run, check if a local image solr-pelican-image is present. If not, build the image. If it exists, use it as-is
  • Re-build image if requirements.txt is newer than latest image build time
  • Add proper getopts argument parsing with pass-through of options to pelican (e.g. -v for verbose)
  • Uses python:3-alpine as image, smaller and no need for preinstalled pelican v4.8.0

This all makes for a much faster workflow and less waste of bandwidth.

@janhoy
Copy link
Contributor Author

janhoy commented Jun 26, 2024

The script is tested on MacOS Sonoma 14.5, and I just tested it on Debian as well.

If anyone have a Linux box or WSL2 Windows box to test on, that would be perfect.

Copy link
Contributor

@gerlowskija gerlowskija left a comment

Choose a reason for hiding this comment

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

LGTM. I don't have a Windows/WSL box to test on unfortunately, but can give another +1 for it working on Mac.

@janhoy janhoy merged commit 7f88bf3 into apache:main Jun 26, 2024
1 check passed
@janhoy janhoy deleted the build-script branch June 26, 2024 20:12
@janhoy
Copy link
Contributor Author

janhoy commented Jun 26, 2024

Thanks for the review. I tried running WSL2 on my M1 mac, and I got all the way to installing Win11 arm in UTM/QEmu, but then it would not allow nested virtualization, so wsl could not be installed. Well.

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