Skip to content

Commit

Permalink
Add comments to ci/Dockerfile, update scripts/gdal.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
danscales committed Jul 12, 2024
1 parent 52b86a7 commit c468a16
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 12 deletions.
11 changes: 11 additions & 0 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# This Dockerfile is to create the image needed to run tests during
# .github/workflow/ciyaml. It includes openjdk-8, git, and gdal. For some reason,
# using Miniconda3 to load gdal broken the libraries needed for git, so we stick with
# old Miniconda here.
#
# Created via:
# docker build -t test -f Dockerfile .
# docker tag test:latest globalforestwatch/openjdk8-gdal3.8.3-slim:latest
# docker login -u username
# docker push globalforestwatch/openjdk8-gdal3.8.3-slim:latest

FROM openjdk:8

ENV SCALA_VERSION=2.12.12
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.sbt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "3"

services:
sbt:
container_name: sbt
image: mozilla/sbt:latest
environment:
- AWS_REGION=us-east-1
volumes:
- $PWD:/opt/app
- ~/.ivy2:/root/.ivy2
- ~/.sbt:/root/.sbt
working_dir: /opt/app
entrypoint: sbt

24 changes: 12 additions & 12 deletions scripts/gdal.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
#!/bin/bash

# This is the bootstrap script used to install GDAL on individual EMR nodes before
# they run.

set -ex

# The default GDAL version would be 3.1.2
# The default GDAL version would be 3.8.3
GDAL_VERSION=$1
GDAL_VERSION=${GDAL_VERSION:="3.1.2"}
GDAL_VERSION=${GDAL_VERSION:="3.8.3"}

# Install GDAL using Miniconda3 (which includes Python 3.12 by default)
# Avoid using default anaconda repo.

# Install Conda
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
sudo sh Miniconda-latest-Linux-x86_64.sh -b -p /usr/local/miniconda
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
sudo sh Miniconda3-latest-Linux-x86_64.sh -b -p /usr/local/miniconda

source ~/.bashrc
export PATH=/usr/local/miniconda/bin:$PATH

# Install GDAL with a specific libcurl version (7.76.1)
conda config --add channels conda-forge
sudo pip3 install tqdm && \
sudo /usr/local/miniconda/bin/conda install python=3.6 -y && \
sudo /usr/local/miniconda/bin/conda install -c anaconda hdf5 -y && \
sudo /usr/local/miniconda/bin/conda install -c cctbx202105 libcurl=7.76.1 -y && \
sudo /usr/local/miniconda/bin/conda install -c conda-forge libnetcdf gdal=${GDAL_VERSION} -y
sudo pip3 install tqdm six && \
sudo /usr/local/miniconda/bin/conda install -c conda-forge --override-channels hdf5 libnetcdf gdal=${GDAL_VERSION} -y

echo "export PATH=/usr/local/miniconda/bin:$PATH" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=/usr/local/miniconda/lib/:/usr/local/lib:/usr/lib/hadoop/lib/native:/usr/lib/hadoop-lzo/lib/native:/docker/usr/lib/hadoop/lib/native:/docker/usr/lib/hadoop-lzo/lib/native:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib" >> ~/.bashrc

0 comments on commit c468a16

Please sign in to comment.