Skip to content

Commit

Permalink
Update build file to include tools for wireless extension
Browse files Browse the repository at this point in the history
Signed-off-by: ZhuoweiWen <[email protected]>
  • Loading branch information
ZhuoweiWen committed Nov 6, 2023
1 parent 159dae6 commit a13d9f1
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 36 deletions.
14 changes: 13 additions & 1 deletion .gitignore
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,16 @@ data/
.env.local
helpful.txt
.env.*
README.md
README.md
# Data
*.tif
*.lcf
*.png
*.ppm
*.kml
*.kmz
*.hgt
*.sdf
*.gpkg
color/
back-end/DEM
82 changes: 50 additions & 32 deletions back-end/Dockerfile.backend
Original file line number Diff line number Diff line change
@@ -1,43 +1,27 @@
FROM python:3.9-slim-buster
FROM ubuntu:20.04

# Basic packages and GDAL's compile dependencies
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
# Install dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
software-properties-common && \
add-apt-repository ppa:ubuntugis/ppa && \
apt-get update && apt-get install -y \
gcc \
python3-dev \
python3-pip \
libpq-dev \
build-essential \
libsqlite3-dev \
sqlite3 \
zlib1g-dev \
wget \
libgdal-dev \
libproj-dev \
libgeos-dev \
libssl-dev \
git \
&& rm -rf /var/lib/apt/lists/*

# Compile and install PROJ 7.1.0 from source
# WORKDIR /proj-src
# RUN wget https://github.com/OSGeo/PROJ/releases/download/7.1.0/proj-7.1.0.tar.gz && \
# tar xvfz proj-7.1.0.tar.gz && \
# cd proj-7.1.0 && \
# ./configure && \
# make -j 4 && \
# make install

# # Set environment variables to help GDAL find PROJ
# ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH \
# PROJ_LIB=/usr/local/share/proj

# # Compile and install GDAL 3.2 using traditional method
# WORKDIR /gdal-src
# RUN wget https://github.com/OSGeo/gdal/releases/download/v3.2.0/gdal-3.2.0.tar.gz && \
# tar xvfz gdal-3.2.0.tar.gz && \
# cd gdal-3.2.0 && \
# ./configure --with-proj=/usr/local && \
# make -j 4 && \
# make install
gdal-bin\
g++ \
cmake \
libbz2-dev \
imagemagick \
zip && \
rm -rf /var/lib/apt/lists/*



# Clone and install Tippecanoe
WORKDIR /tippecanoe
Expand All @@ -49,8 +33,42 @@ RUN git clone https://github.com/mapbox/tippecanoe.git && \
# Check if Tippecanoe is in PATH
RUN which tippecanoe || { echo 'Tippecanoe not found in PATH'; exit 1; }

# Set the working directory to /Signal-Server
WORKDIR /Signal-Server

# Clone Signal-Server repository
RUN git clone https://github.com/Cloud-RF/Signal-Server.git .

# Change to the source directory and build the binaries
WORKDIR /Signal-Server/src

# Before running cmake, we should ensure that the RUNTIME DESTINATION is specified in CMakeLists.txt.
# If the CMakeLists.txt is not correctly setting the RUNTIME DESTINATION, you can use a sed command to replace it with the correct line. For example:
RUN sed -i 's/install(TARGETS signalserver)/install(TARGETS signalserver RUNTIME DESTINATION bin)/' CMakeLists.txt
RUN sed -i 's/install(TARGETS signalserverHD)/install(TARGETS signalserverHD RUNTIME DESTINATION bin)/' CMakeLists.txt
RUN sed -i 's/install(TARGETS signalserverLIDAR)/install(TARGETS signalserverLIDAR RUNTIME DESTINATION bin)/' CMakeLists.txt

# Run cmake and make, specifying a runtime destination
RUN cmake -DCMAKE_INSTALL_PREFIX=/usr/local . && \
make

# Add /usr/local/bin to the PATH, just in case it's not
ENV PATH="/Signal-Server/src:${PATH}"

# Check if signalserver is in PATH
RUN which signalserver || { echo 'Signal-Server not found in PATH'; exit 1; }

WORKDIR /Signal-Server/output/GoogleEarth
# Modify runsig.sh to use signalserverHD instead of signalserver
RUN sed -i 's/time signalserver -sdf/time signalserverHD -sdf/' runsig.sh

ENV PATH="/Signal-Server/output/GoogleEarth:${PATH}"

Run which runsig.sh || { echo 'runsig not found in PATH'; exit 1; }

WORKDIR /app

# COPY ./idaho_sdf1 ./one-arc-second-data
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt

Expand Down
54 changes: 51 additions & 3 deletions back-end/Dockerfile.worker
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
FROM python:3.9-slim-buster
FROM ubuntu:20.04

RUN apt-get update && apt-get install -y \
# Install dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
software-properties-common && \
add-apt-repository ppa:ubuntugis/ppa && \
apt-get update && apt-get install -y \
gcc \
python3-dev \
python3-pip \
libpq-dev \
build-essential \
libsqlite3-dev \
zlib1g-dev \
git \
&& rm -rf /var/lib/apt/lists/*
gdal-bin\
g++ \
cmake \
libbz2-dev \
imagemagick \
zip && \
rm -rf /var/lib/apt/lists/*



# Clone and install Tippecanoe
WORKDIR /tippecanoe
Expand All @@ -20,9 +33,44 @@ RUN git clone https://github.com/mapbox/tippecanoe.git && \
# Check if Tippecanoe is in PATH
RUN which tippecanoe || { echo 'Tippecanoe not found in PATH'; exit 1; }

# Set the working directory to /Signal-Server
WORKDIR /Signal-Server

# Clone Signal-Server repository
RUN git clone https://github.com/Cloud-RF/Signal-Server.git .

# Change to the source directory and build the binaries
WORKDIR /Signal-Server/src

# Before running cmake, we should ensure that the RUNTIME DESTINATION is specified in CMakeLists.txt.
# If the CMakeLists.txt is not correctly setting the RUNTIME DESTINATION, you can use a sed command to replace it with the correct line. For example:
RUN sed -i 's/install(TARGETS signalserver)/install(TARGETS signalserver RUNTIME DESTINATION bin)/' CMakeLists.txt
RUN sed -i 's/install(TARGETS signalserverHD)/install(TARGETS signalserverHD RUNTIME DESTINATION bin)/' CMakeLists.txt
RUN sed -i 's/install(TARGETS signalserverLIDAR)/install(TARGETS signalserverLIDAR RUNTIME DESTINATION bin)/' CMakeLists.txt

# Run cmake and make, specifying a runtime destination
RUN cmake -DCMAKE_INSTALL_PREFIX=/usr/local . && \
make

# Add /usr/local/bin to the PATH, just in case it's not
ENV PATH="/Signal-Server/src:${PATH}"

# Check if signalserver is in PATH
RUN which signalserver || { echo 'Signal-Server not found in PATH'; exit 1; }

WORKDIR /Signal-Server/output/GoogleEarth
# Modify runsig.sh to use signalserverHD instead of signalserver
RUN sed -i 's/time signalserver -sdf/time signalserverHD -sdf/' runsig.sh

ENV PATH="/Signal-Server/output/GoogleEarth:${PATH}"

Run which runsig.sh || { echo 'runsig not found in PATH'; exit 1; }

WORKDIR /app

# COPY ./idaho_sdf1 ./one-arc-second-data
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt

COPY . .

0 comments on commit a13d9f1

Please sign in to comment.