Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
67 changes: 67 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
FROM ubuntu:22.04
SHELL ["/bin/bash", "-c"]
ENV SHELL=/bin/bash
ENV TZ=Europe/London

# Manually set timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Force shell to use bash
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

# Update aptitude
RUN export DEBIAN_FRONTEND=noninteractive && \
apt update -y && \
apt upgrade -y && \
apt install -y software-properties-common

# Install Python3.11
RUN export DEBIAN_FRONTEND=noninteractive && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt update -y && \
apt install -y \
python3.11 \
python3.11-venv \
python3.11-distutils \
python3.11-dev \
python3-pip
RUN rm /usr/bin/python3 && \
ln -s $(which python3.11) /usr/bin/python3
RUN rm -f /usr/bin/python && \
ln -s $(which python3.11) /usr/bin/python
RUN python3 -m pip install poetry poethepoet
RUN python3 -m pip install cmake==3.24

# Install NodeJS
ENV NVM_DIR=/usr/local/nvm
ENV NODE_VERSION=22
RUN export DEBIAN_FRONTEND=noninteractive && \
apt install -y curl
RUN mkdir -p $NVM_DIR
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
RUN source $NVM_DIR/nvm.sh && \
nvm install $NODE_VERSION && \
nvm alias default $NODE_VERSION && \
nvm use default

ENV NODE_PATH=$NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH=$NVM_DIR/v$NODE_VERSION/bin:$PATH

# Copy the whole of Gator into the container
COPY . /root/gator

# Install poetry and python dependencies
RUN python3.11 -m pip install poetry poethepoet
RUN cd /root/gator && poetry lock && poetry install

# Install npm dependencies and then build the frontend
RUN source $NVM_DIR/nvm.sh && \
cd /root/gator/gator-hub && \
npm install && \
npm run build

# Launch Gator
ENV GATOR_HUB_ROOT=/root/gator/gator-hub/dist
WORKDIR /root/gator
ENTRYPOINT ["poetry", "run", "python3.11", "-m", "gator.hub"]
CMD ["--host", "0.0.0.0", "--port", "8080", "--db-host", "127.0.0.1", "--db-port", "5432"]
2 changes: 1 addition & 1 deletion gator-hub/src/features/JobDashboard/lib/jobtree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type JobNode = TreeNode<Job>;
* Splits strings into alpha and numeric portions before comparison
* and tries to treat the numeric portions as numbers.
*/
function naturalCompare(a: String | Number, b: String | Number) {
function naturalCompare(a: String | Number | bigint, b: String | Number | bigint) {
const num_regex = /(\d+\.?\d*)/g
const aParts = a.toString().split(num_regex);
const bParts = b.toString().split(num_regex);
Expand Down