Skip to content

Commit

Permalink
Docker updates for dev-31 and Ubuntu:jammy
Browse files Browse the repository at this point in the history
- Point deploy-nightly-docker.sh to jammy branch
  • Loading branch information
Geomet user for nightly docker builds committed Dec 6, 2024
1 parent 7582550 commit a358c33
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 22 deletions.
20 changes: 9 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,29 @@
#
###################################################################

FROM ubuntu:focal
FROM ubuntu:jammy

ARG PYGEOAPI_GITREPO=https://github.com/geopython/pygeoapi.git

ENV BASEDIR=/data/web/msc-pygeoapi-nightly
ENV DEBIAN_FRONTEND=noninteractive

WORKDIR $BASEDIR

# Install system deps
RUN sed -i 's/http:\/\/archive.ubuntu.com\/ubuntu\//mirror:\/\/mirrors.ubuntu.com\/mirrors.txt/g' /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:gcpp-kalxas/wmo && \
add-apt-repository ppa:ubuntugis/ppa && apt update && \
apt-get install -y python3 python3-setuptools python3-pip git curl unzip python3-click python3-fiona python3-gdal python3-lxml python3-parse python3-pyproj python3-rasterio python3-requests python3-slugify python3-sqlalchemy python3-unicodecsv python3-xarray python3-yaml
apt-get install -y software-properties-common && \
add-apt-repository ppa:gcpp-kalxas/wmo-staging && \
add-apt-repository ppa:ubuntugis/ppa && apt update
RUN apt-get install -y python3 python3-setuptools python3-pip git curl unzip python3-click python3-fiona python3-gdal python3-lxml python3-parse python3-pyproj python3-rasterio python3-requests python3-slugify python3-sqlalchemy python3-unicodecsv python3-xarray python3-yaml

# install pygeoapi
RUN git clone $PYGEOAPI_GITREPO -b 0.16.1 && \
RUN git clone $PYGEOAPI_GITREPO -b 0.18.0 && \
cd pygeoapi && \
pip3 install -r requirements.txt && \
pip3 install flask_cors gunicorn gevent greenlet && \
python3 setup.py install && \
pip3 install . && \
cd ..

# requirement of GEOMET_CLIMATE_CONFIG file
Expand All @@ -63,11 +64,8 @@ RUN mkdir schemas.opengis.net && \
# install msc-pygeoapi
COPY . $BASEDIR/msc-pygeoapi
RUN cd msc-pygeoapi && \
# requirements.txt includes elasticsearch<8
pip3 install -r requirements.txt && \
pip3 install elasticsearch_dsl && \
pip3 install -U elasticsearch_dsl && \
pip3 install -U elasticsearch && \
# ensure cors enabled in config
sed -i 's^# cors: true^cors: true^' $BASEDIR/msc-pygeoapi/deploy/default/msc-pygeoapi-config.yml && \
# GCWeb theme files
Expand All @@ -77,7 +75,7 @@ RUN cd msc-pygeoapi && \
mv ./theme/static/themes-dist-14.6.0-gcweb ./theme/static/themes-gcweb && \
rm -f ./themes-gcweb.zip && \
# install msc-pygeoapi
python3 setup.py install && \
pip3 install . && \
# show version
MSC_PYGEOAPI_VERSION=$(dpkg-parsechangelog -SVersion) && \
sed -i "s/MSC_PYGEOAPI_VERSION/$MSC_PYGEOAPI_VERSION/" theme/templates/_base.html && \
Expand Down
2 changes: 1 addition & 1 deletion deploy/nightly/deploy-nightly-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ echo "Generating nightly build for $TIMESTAMP"
mkdir $NIGHTLYDIR && cd $NIGHTLYDIR

echo "Cloning Git repository"
git clone $MSC_PYGEOAPI_GITREPO . -b master --depth=1
git clone $MSC_PYGEOAPI_GITREPO . -b jammy --depth=1

echo "Stopping/building/starting Docker setup"
docker compose -f docker/docker-compose.yml -f docker/docker-compose.override.yml build --no-cache
Expand Down
2 changes: 1 addition & 1 deletion deploy/nightly/deploy-nightly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ BASEDIR=/data/web/msc-pygeoapi-nightly
PYGEOAPI_GITREPO=https://github.com/geopython/pygeoapi.git
MSC_PYGEOAPI_GITREPO=https://github.com/ECCC-MSC/msc-pygeoapi.git
DAYSTOKEEP=7
export MSC_PYGEOAPI_OGC_API_URL=https://geomet-dev-22-nightly.cmc.ec.gc.ca/msc-pygeoapi/nightly/latest/
export MSC_PYGEOAPI_OGC_API_URL=https://geomet-dev-31-nightly.edc-mtl.ec.gc.ca/msc-pygeoapi/nightly/latest/
export MSC_PYGEOAPI_ES_URL=http://localhost:9200
export MSC_PYGEOAPI_OGC_API_URL_BASEPATH=/
export MSC_PYGEOAPI_TEMPLATES=/data/web/msc-pygeoapi-nightly/latest/msc-pygeoapi/theme/templates
Expand Down
2 changes: 1 addition & 1 deletion deploy/nightly/msc-pygeoapi.wsgi
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import sys
os.environ['PYGEOAPI_CONFIG'] = '/data/web/msc-pygeoapi-nightly/latest/msc-pygeoapi/deploy/nightly/msc-pygeoapi-config.yml'
os.environ['PYGEOAPI_OPENAPI'] = '/data/web/msc-pygeoapi-nightly/latest/msc-pygeoapi/deploy/nightly/msc-pygeoapi-openapi.yml'
os.environ['MSC_PYGEOAPI_ES_URL'] = 'http://localhost:9200'
os.environ['MSC_PYGEOAPI_OGC_API_URL'] = 'https://geomet-dev-22-nightly.cmc.ec.gc.ca/msc-pygeoapi/nightly/latest'
os.environ['MSC_PYGEOAPI_OGC_API_URL'] = 'https://geomet-dev-31-nightly.edc-mtl.ec.gc.ca/msc-pygeoapi'
os.environ['MSC_PYGEOAPI_OGC_API_URL_BASEPATH'] = '/'
os.environ['MSC_PYGEOAPI_TEMPLATES'] = '/data/web/msc-pygeoapi-nightly/latest/msc-pygeoapi/theme/templates'
os.environ['MSC_PYGEOAPI_STATIC'] = '/data/web/msc-pygeoapi-nightly/latest/msc-pygeoapi/theme/static'
Expand Down
4 changes: 2 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ docker compose -f docker/docker-compose.yml -f docker/docker-compose.override.ym

# test OGC API endpoint
```bash
curl "http://geomet-dev-22.cmc.ec.gc.ca:5089"
curl "http://geomet-dev-31.edc-mtl.ec.gc.ca:5089"
# or
curl "https://geomet-dev-22-nightly.cmc.ec.gc.ca/msc-pygeoapi"
curl "https://geomet-dev-31-nightly.edc-mtl.ec.gc.ca/msc-pygeoapi"
```
7 changes: 2 additions & 5 deletions docker/default.env
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
BASEDIR=/data/web/msc-pygeoapi-nightly
PYGEOAPI_CONFIG=${BASEDIR}/msc-pygeoapi/deploy/default/msc-pygeoapi-config.yml
PYGEOAPI_OPENAPI=${BASEDIR}/msc-pygeoapi/deploy/nightly/msc-pygeoapi-openapi.yml
# MSC_PYGEOAPI_OGC_API_URL=http://geomet-dev-22.cmc.ec.gc.ca:5089
# MSC_PYGEOAPI_OGC_API_URL_BASEPATH=/
MSC_PYGEOAPI_OGC_API_URL=https://geomet-dev-22-nightly.cmc.ec.gc.ca/msc-pygeoapi
# MSC_PYGEOAPI_OGC_API_URL=http://geomet-dev-31.cmc.ec.gc.ca:5089
MSC_PYGEOAPI_OGC_API_URL=https://geomet-dev-31-nightly.edc-mtl.ec.gc.ca/msc-pygeoapi
MSC_PYGEOAPI_OGC_API_URL_BASEPATH=/
# MSC_PYGEOAPI_ES_USERNAME=foo
# MSC_PYGEOAPI_ES_PASSWORD=bar
# ES credentials loaded from host env
MSC_PYGEOAPI_ES_URL=http://${MSC_PYGEOAPI_ES_USERNAME}:${MSC_PYGEOAPI_ES_PASSWORD}@localhost:9200
MSC_PYGEOAPI_ES_TIMEOUT=90
Expand Down
2 changes: 1 addition & 1 deletion msc_pygeoapi/process/weather/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Fifth start pygeoapi
```bash
pygeoapi serve
```
Visit http://geomet-dev-22.cmc.ec.gc.ca:5000
Visit http://geomet-dev-31.edc-mtl.ec.gc.ca:5000

Note: port 5000 is default port. Check `/deploy/default/msc-pygeoapi-config.yml` to double check port

Expand Down

0 comments on commit a358c33

Please sign in to comment.