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

[3pt] PR: Docker, python packages and jdk updates #1217

Merged
merged 10 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

### Testing


### Deployment Plan (For developer use)

_How does the changes affect the product?_
- [ ] Code only?
- [ ] If applicable, has a deployment plan be created with the deployment person/team?
- [ ] Require new or adjusted data inputs? Does it have start, end and duration code (in UTC)?
- [ ] If new or updated data sets, has the FIM code been updated and tested with the new/adjusted data (subset is fine, but must be a subset of the new data)?
- [ ] Require new pre-clip set?
- [ ] Has new or updated python packages?
- [ ] If applicable, has a deployment plan be created with the deployment person/team?


### Issuer Checklist (For developer use)

Expand All @@ -30,11 +30,9 @@ _You may update this checklist before and/or after creating the PR. If you're un
- [ ] The feature branch you're submitting as a PR is up to date (merged) with the latest `dev` branch
- [ ] `pre-commit` hooks were run locally
- [ ] Any _change_ in functionality is tested
- [ ] Passes all unit tests locally (inside interactive Docker container, at `/foss_fim/`, run: `pytest unit_tests/`)
- [ ] New functions are documented (with a description, list of inputs, and expected output)
- [ ] Placeholder code is flagged / future todos are captured in comments
- [ ] [CHANGELOG](/docs/CHANGELOG.md) updated with template version number, e.g. `4.x.x.x`
- [ ] [Reviewers requested](https://help.github.com/articles/requesting-a-pull-request-review/)
- [ ] Add yourself as an [assignee](https://docs.github.com/en/issues/tracking-your-work-with-issues/assigning-issues-and-pull-requests-to-other-github-users) in the PR as well as the FIM Technical Lead

### Merge Checklist (For Technical Lead use only)
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ config/**
config/*.swp
.vscode/
**/.DS_Store
**/*_pytest.py
.private/
12 changes: 3 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ guidance below.
## Changing the code-base

Generally speaking, you should fork this repository, make changes in your
own fork, and then submit a pull request. All new code should have associated
unit tests (added to `/unit_tests`) that validate implemented features and the presence or lack of defects.
own fork, and then submit a pull request.
Additionally, the code should follow any stylistic and architectural guidelines
prescribed by the project. In the absence of such guidelines, mimic the styles
and patterns in the existing code-base.
Expand Down Expand Up @@ -118,19 +117,14 @@ If you would like to contribute, please follow these steps:
# optionally close the container
# Back on your terminal console (outside the container), use the typical git add, git commit, git push


8. [Within the container](README.md#startrun-the-docker-container), ensure sure unit tests pass ([instructions here](/unit_tests/README.md)).
```
pytest unit_tests/
```

9. Outside of the Docker container, commit your changes:
8. Outside of the Docker container, commit your changes:
```
git commit -m "<descriptive sentence or two of changes>"
```
This will invoke pre-commit hooks mentioned in step 6 that will lint & format the code (some others as well). In many cases non-compliant code will be rectified automatically, but in some cases manual changes will be necessary. Make sure all of these checks pass. If not, make necessary changes (`git add <...>`), and re-issue `git commit -m "<...>"`.

10. Push to your forked branch:
9. Push to your forked branch:
```
git push -u origin
```
Expand Down
17 changes: 14 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,17 @@ COPY --from=builder $depDir $depDir
# remove reference to missing repo
RUN rm /etc/apt/sources.list.d/apache-arrow.sources

RUN apt-get update --fix-missing && apt-get install -y openjdk-19-jdk && rm -rf /var/lib/apt/lists/*

RUN apt-get update --fix-missing && apt-get install -y openjdk-21-jdk && rm -rf /var/lib/apt/lists/*
RUN apt update --fix-missing

# An older version of openjdk still exists on the file system but was never cleaned up
# After research, we realized, it just needs file cleanup. Leaving it there is triggering security warnings
# RUN apt-get remove -y openjdk-17-jdk (not installed, just residue left)
RUN rm -rf ./usr/lib/jvm/*java-1.17* && \
rm -rf ./usr/lib/jvm/.java-1.17* && \
rm -rdf ./usr/lib/jvm/java-17*


RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install -y p7zip-full python3-pip time mpich parallel libgeos-dev expect tmux rsync tzdata

RUN apt auto-remove
Expand All @@ -91,7 +99,9 @@ ENV PYTHONUNBUFFERED=TRUE

## ADD TO PATHS ##
ENV PATH="$projectDir:${PATH}"
ENV PYTHONPATH=${PYTHONPATH}:$srcDir:$projectDir/unit_tests:$projectDir/tools
#ENV PATH=${PATH}:$projectDir:$projectDir/$srcDir:$projectDir/tools
# Jul 17, 2024: Even though PYTHONPATH isn't used, it still seems to want it.
ENV PYTHONPATH=${PATH}:$srcDir:$projectDir/tools

## install python 3 modules ##

Expand All @@ -110,6 +120,7 @@ RUN pip3 install pipenv==2023.12.1 && PIP_NO_CACHE_DIR=off pipenv install --syst
# We download and unzip it to the same file folder that pip deployed the whitebox library.
# Whitebox also attempts to always download a folder called testdata regardless of use.
# We added an empty folder to fake out whitebox_tools.py so it doesn't try to download the folder

# RUN wbox_path=/usr/local/lib/python3.10/dist-packages/whitebox/WBT && \
# wget -P $wbox_path https://www.whiteboxgeo.com/WBT_Linux/WhiteboxTools_linux_musl.zip && \
# unzip -o $wbox_path/WhiteboxTools_linux_musl.zip -d $wbox_path && \
Expand Down
20 changes: 11 additions & 9 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ verify_ssl = true
ipython = "==8.24.0"

[packages]
certifi = "==2023.7.22"
certifi = "==2024.7.4"
fiona = "==1.8.22"
geopandas = "==0.14.3"
numba = "==0.56.4"
numpy = "==1.23.5"
numba = "==0.60.0"
numpy = "==1.26.4"
pandas = "==2.0.2"
rasterio = "==1.3.6"
rasterstats = "==0.18.0"
Expand All @@ -20,7 +20,7 @@ tqdm = "==4.66.3"
seaborn = "==0.12.2"
python-dotenv = "==1.0.0"
natsort = "==8.3.1"
xarray = "==2023.1.0"
xarray = "==2024.6.0"
netcdf4 = "==1.6.3"
tables = "==3.8.0"
pyproj = "==3.5.0"
Expand All @@ -29,20 +29,19 @@ boto3 = "==1.26.109"
jupyter = "==1.0.0"
jupyterlab = "==3.6.7"
ipympl = "==0.9.3"
pytest = "==7.3.0"
whitebox = "2.3.4"
whitebox = "==2.3.4"
shapely = "==2.0.1"
pyarrow = "==14.0.1"
rtree = "==1.0.1"
py7zr = "==0.20.4"
scipy = "==1.10.1"
gval = "==0.2.3"
scipy = "==1.14.0"
gval = "==0.2.7"
flake8 = "==6.0.0"
black = "==24.3.0"
flake8-pyproject = "==1.2.3"
pre-commit = "==3.3.3"
isort = "==5.12.0"
urllib3 = "==1.26.18"
urllib3 = "==1.26.19"
pyflwdir = "==0.5.8"
pillow = "==10.3.0"
pyogrio = "==0.7.2"
Expand All @@ -52,6 +51,9 @@ lmoments3 = "==1.0.6"
zarr = "==2.18.0"
requests = "==2.32.3"
aiohttp = "==3.9.5"
distributed = "==2024.6.2"
monaco = "==0.13.1"
dask = "==2024.6.2"

[requires]
python_version = "3.10"
Loading
Loading