Skip to content

Commit

Permalink
Update to new ubuntu base image, fix subpaths
Browse files Browse the repository at this point in the history
  • Loading branch information
mpiannucci committed May 3, 2024
1 parent 8dc9621 commit e296609
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 32 deletions.
37 changes: 14 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


# Build the react frontend
FROM node:18-alpine

Expand All @@ -13,25 +15,23 @@ COPY viewer/index.html ./index.html
COPY viewer/public ./public
COPY viewer/src ./src

ARG ROOT_PATH=/xreds/
ENV VITE_XREDS_BASE_URL=${ROOT_PATH}
RUN npm run build

# Build the python service layer
FROM public.ecr.aws/b1r9q1p5/rps-matplotlib:latest

# Native dependencies
RUN dnf -y install \
gcc \
gcc-c++ \
make \
RUN apt-get update && apt-get install -y \
git \
gcc-gfortran \
openblas-devel \
geos-devel \
netcdf-devel \
proj-devel \
udunits2-devel \
eccodes-devel
# RUN apt-get install -y git libc-dev gcc g++ libffi-dev build-essential libudunits2-dev libgdal-dev libnetcdf-dev libeccodes-dev libgeos-dev cmake libopenblas-dev
libhdf5-dev \
libopenblas-dev \
libgeos-dev \
libnetcdf-dev \
libproj-dev \
libudunits2-dev \
libeccodes-dev

# Create a folder for the app to live in
RUN mkdir -p /opt/xreds
Expand Down Expand Up @@ -64,17 +64,8 @@ COPY --from=0 /opt/viewer/dist ./viewer/dist

# Set the port to run the server on
ENV PORT 8090
ENV ROOT_PATH "/xreds/"

RUN dnf -y remove \
wget \
make \
gcc \
gcc-c++ \
git \
&& dnf autoremove -y \
&& dnf clean dbcache \
&& dnf clean all
ARG ROOT_PATH=/xreds/
ENV ROOT_PATH ${ROOT_PATH}

# Run the webserver
CMD ["sh", "-c", "gunicorn --workers=1 --worker-class=uvicorn.workers.UvicornWorker --log-level=debug --bind=0.0.0.0:${PORT} app:app"]
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ scipy==1.13.0
kerchunk@git+https://github.com/fsspec/kerchunk@8d8e84c619a63d4372b33b05c9bfe35fdcb6e61d
xpublish-opendap@git+https://github.com/xpublish-community/xpublish-opendap@6020c0464f9b7f872f4307dab9d7c97d5d981387
xpublish-wms@git+https://github.com/xpublish-community/xpublish-wms@9574a71405e43c479b7ebcfa1e5d0def04c598d5
xpublish-edr@git+https://github.com/xpublish-community/xpublish-edr@0a4505b30696dec30dc95e0ffe12ea6b598930d7
xpublish-edr@git+https://github.com/xpublish-community/xpublish-edr@019e53acd2e0ad5a1d909d1acfe9863f2e90e51b
opendap-protocol<1.2.0
xarray-subset-grid@git+https://github.com/asascience-open/xarray-subset-grid@81ce464b6357e7353deaaf350ad1be22295d238e
3 changes: 2 additions & 1 deletion viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"check": "tsc --noEmit",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
Expand Down
4 changes: 3 additions & 1 deletion viewer/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const router = createBrowserRouter([
element: <SubsetTool />,
errorElement: <ErrorPage />,
},
]);
], {
basename: import.meta.env.VITE_XREDS_BASE_URL,
});

const queryClient = new QueryClient();

Expand Down
1 change: 1 addition & 0 deletions viewer/src/pages/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ function App() {
{datasets.at(i)?.isFetched && (
<>
<a
target="_blank"
href={`/datasets/${datasetIds.data.at(i)}/`}
>
<MaterialIcon
Expand Down
7 changes: 1 addition & 6 deletions viewer/src/pages/subset_tool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ import Map from '../components/map';
import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
import MapboxDraw from '@mapbox/mapbox-gl-draw';

import {
useDatasetIdsQuery,
useDatasetMetadataQuery,
useDatasetsQuery,
} from '../query/datasets';
import Spinner from '../components/spinner';
import { useQuery } from '@tanstack/react-query';
import MaterialIcon from '../components/material_icon';
import CopyUrl from '../components/copy_url';
import { useSearchParams } from 'react-router-dom';
import { useDatasetIdsQuery } from '../query/datasets';

const useExportThreshold = () =>
useQuery({
Expand Down

0 comments on commit e296609

Please sign in to comment.