Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a Dockerfile and fixing lint errors #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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"]
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { TreeKey } from "./Dashboard/lib/tree";
import { ApiJob } from "@/types/job";
import { Reader } from "../lib/readers";

/*
enum Severity {
CRITICAL = 50,
FATAL = CRITICAL,
Expand All @@ -20,6 +21,7 @@ enum Severity {
DEBUG = 10,
NOTSET = 0
}
*/

enum Status {
ERROR,
Expand Down
4 changes: 2 additions & 2 deletions gator-hub/src/features/JobDashboard/lib/jobtree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { ApiJob, Job, JobState } from "@/types/job";
import Tree, { TreeKey, TreeNode } from "../components/Dashboard/lib/tree";
import Tree, { TreeNode } from "../components/Dashboard/lib/tree";
import moment from "moment";

export type JobNode = TreeNode<Job>;
Expand All @@ -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
Loading