diff --git a/Dockerfile b/Dockerfile index 03d4af8..0545781 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,12 @@ FROM node:16 AS builder +ARG IP +ARG PORT + WORKDIR /builder + COPY package.json ./ RUN npm config set legacy-peer-deps true @@ -11,8 +15,14 @@ RUN npm install COPY . ./ -#RUN npm run build -RUN ./deploy.sh -c +COPY deploy.sh /deploy.sh + +# Replace the placeholders in the deploy script with the IP and port +RUN sed -i "s/{{IP}}/$IP/g" /deploy.sh && \ + sed -i "s/{{PORT}}/$PORT/g" /deploy.sh && \ + chmod +x /deploy.sh + +RUN ./deploy.sh -p # Production image @@ -38,5 +48,11 @@ RUN cat /tmp/nginx.conf >nginx.conf # RUN cat nginx.conf # ENTRYPOINT ["/bin/sh", "-c" ,"nginx -t && nginx -g daemon off;"] +Expose 80 +#RUN npm run start + +# Start the deployment script and create an ssh tunnel +#CMD ["/bin/sh", "-c", "./deploy.sh -d "] ENTRYPOINT ["nginx", "-g", "daemon off;"] + diff --git a/deploy.sh b/deploy.sh index f212417..067f6a1 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,5 +1,21 @@ #!/bin/bash -source getotps.sh +#source getotps.sh + + +export CLUSTER_IP=$IP +export AUTOTUNE_PORT=$PORT + +echo $CLUSTER_IP +echo $AUTOTUNE_PORT + + +if [[ -z "$CLUSTER_IP" ]]; then + source getotps.sh + echo "in getotps" +else + echo "CLUSTERIP is set to $CLUSTERIP" +fi + function start_gui_dev_mode() { if command -v npm then @@ -15,8 +31,8 @@ function start_gui_prod_mode() { then echo "npm is NOT Installed on your machine." else - npm run build - npm run start + npm run build + #npm run start fi echo "prod m" } diff --git a/src/app/About/About.tsx b/src/app/About/About.tsx index ed7b621..f255f36 100644 --- a/src/app/About/About.tsx +++ b/src/app/About/About.tsx @@ -13,11 +13,11 @@ import { RunExperiment } from '@app/RunExperiment/RunExperiment'; const About = () => ( - About Kruize + About Kruize
- + Autotune is an Autonomous Performance Tuning Tool for Kubernetes. Autotune accepts a user provided Service Level Objective or "slo" goal to optimize application performance. It uses Prometheus to identify "layers" of an application that it is monitoring and matches tunables from those layers to the user provided slo. It then runs diff --git a/src/app/AppLayout/AppLayout.tsx b/src/app/AppLayout/AppLayout.tsx index 40c6bb1..9519f7f 100644 --- a/src/app/AppLayout/AppLayout.tsx +++ b/src/app/AppLayout/AppLayout.tsx @@ -14,7 +14,7 @@ import { routes, IAppRoute, IAppRouteGroup } from '@app/routes'; import HorizontalNav from '@app/HorizontalNav/HorizontalNav'; import EnvState from '@app/ContextStore/EnvState'; import Footer from '@app/Footer/Footer'; -import KruizeLogo from '@app/HorizontalNav/Assets/kruize_icon.png' +import KruizeLogo from '!!url-loader!@app/Assets/images/kruize_icon.png' interface IAppLayout { children: React.ReactNode; } diff --git a/src/favicon.png b/src/app/Assets/favicon/favicon.png similarity index 100% rename from src/favicon.png rename to src/app/Assets/favicon/favicon.png diff --git a/src/app/Assets/fonts/RedHatDisplay-Medium.woff b/src/app/Assets/fonts/RedHatDisplay-Medium.woff new file mode 100644 index 0000000..a5fadd6 Binary files /dev/null and b/src/app/Assets/fonts/RedHatDisplay-Medium.woff differ diff --git a/src/app/Assets/fonts/RedHatDisplay-Medium.woff2 b/src/app/Assets/fonts/RedHatDisplay-Medium.woff2 new file mode 100644 index 0000000..7a76ecc Binary files /dev/null and b/src/app/Assets/fonts/RedHatDisplay-Medium.woff2 differ diff --git a/src/app/Assets/fonts/RedHatText-Regular.woff b/src/app/Assets/fonts/RedHatText-Regular.woff new file mode 100644 index 0000000..07dc1d7 Binary files /dev/null and b/src/app/Assets/fonts/RedHatText-Regular.woff differ diff --git a/src/app/Assets/fonts/RedHatText-Regular.woff2 b/src/app/Assets/fonts/RedHatText-Regular.woff2 new file mode 100644 index 0000000..c3944bd Binary files /dev/null and b/src/app/Assets/fonts/RedHatText-Regular.woff2 differ diff --git a/src/app/Assets/fonts/overpass-light.woff b/src/app/Assets/fonts/overpass-light.woff new file mode 100644 index 0000000..e4ba3cf Binary files /dev/null and b/src/app/Assets/fonts/overpass-light.woff differ diff --git a/src/app/Assets/fonts/overpass-light.woff2 b/src/app/Assets/fonts/overpass-light.woff2 new file mode 100644 index 0000000..ab70760 Binary files /dev/null and b/src/app/Assets/fonts/overpass-light.woff2 differ diff --git a/src/app/HorizontalNav/Assets/Avatar_image.svg b/src/app/Assets/images/Avatar_image.svg similarity index 100% rename from src/app/HorizontalNav/Assets/Avatar_image.svg rename to src/app/Assets/images/Avatar_image.svg diff --git a/src/app/HorizontalNav/Assets/Kubernetes_image.png b/src/app/Assets/images/Kubernetes_image copy.png similarity index 100% rename from src/app/HorizontalNav/Assets/Kubernetes_image.png rename to src/app/Assets/images/Kubernetes_image copy.png diff --git a/src/app/Assets/images/Kubernetes_image.png b/src/app/Assets/images/Kubernetes_image.png new file mode 100644 index 0000000..05fc5e1 Binary files /dev/null and b/src/app/Assets/images/Kubernetes_image.png differ diff --git a/src/app/HorizontalNav/Assets/kruize_icon.png b/src/app/Assets/images/kruize_icon.png similarity index 100% rename from src/app/HorizontalNav/Assets/kruize_icon.png rename to src/app/Assets/images/kruize_icon.png diff --git a/src/app/HorizontalNav/Assets/kruize_logo.svg b/src/app/HorizontalNav/Assets/kruize_logo.svg deleted file mode 100644 index c2ac1bd..0000000 --- a/src/app/HorizontalNav/Assets/kruize_logo.svg +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/app/HorizontalNav/HorizontalNav.tsx b/src/app/HorizontalNav/HorizontalNav.tsx index f7d3297..fdfee41 100644 --- a/src/app/HorizontalNav/HorizontalNav.tsx +++ b/src/app/HorizontalNav/HorizontalNav.tsx @@ -1,8 +1,8 @@ import React, { useState, useEffect, useContext } from 'react'; import { Popover, Nav, TextContent, Avatar, Text, TextVariants, NavItem, NavList, Flex } from '@patternfly/react-core'; -import Kubernetes_image from './Assets/Kubernetes_image.png'; -import Kruize_logo from './Assets/kruize_icon.png'; -import Avatar_image from './Assets/Avatar_image.svg'; +import Kubernetes_image from '!!url-loader!@app/Assets/images/Kubernetes_image.png'; +// import Kruize_logo from '!!url-loader!@app/assets/images/kruize_icon.png'; +import Avatar_image from '!!url-loader!@app/Assets/images/Avatar_image.svg'; import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon'; import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon'; import nodeContext from '@app/ContextStore/nodeContext'; diff --git a/src/app/app.css b/src/app/app.css index 1254c55..991e4dc 100644 --- a/src/app/app.css +++ b/src/app/app.css @@ -25,3 +25,31 @@ body, .pf-c-button { justify-items: right; } + +@font-face { + font-family: 'RedHatDisplay'; + src: url('!!url-loader!@app/Assets/fonts/RedHatDisplay-Medium.woff') format('woff'), + url('!!url-loader!@app/Assets/fonts/RedHatDisplay-Medium.woff2') format('woff2'); + font-weight:400; + font-style: normal; +} + +@font-face { + font-family: 'RedHatTextRegular'; + src: url('!!url-loader!@app/Assets/fonts/RedHatText-Regular.woff') format('woff'), + url('!!url-loader!@app/Assets/fonts/RedHatText-Regular.woff2') format('woff2'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'overpass'; + src: url('!!url-loader!@app/Assets/fonts/overpass-light.woff') format('woff'), + url('!!url-loader!@app/Assets/fonts/overpass-light.woff2') format('woff2'); + font-weight: 400; + font-style: normal; +} + +body { + font-family: 'overpass'; +} \ No newline at end of file diff --git a/src/index.html b/src/index.html index 4bc71ab..f03bc50 100644 --- a/src/index.html +++ b/src/index.html @@ -5,7 +5,8 @@ Kruize - + + diff --git a/webpack.common.js b/webpack.common.js index 09d146b..34df307 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -350,17 +350,20 @@ module.exports = env => { }, plugins: [ new HtmlWebpackPlugin({ - template: path.resolve(__dirname, 'src', 'index.html') + template: path.resolve(__dirname, 'src', 'index.html'), + favicon: path.resolve(__dirname, 'src/app/Assets/favicon', 'favicon.png') + }), new Dotenv({ systemvars: true, silent: true }), - new CopyPlugin({ - patterns: [ - { from: './src/favicon.png', to: 'images' }, - ] - }) + // new CopyPlugin({ + // patterns: [ + // { from: './src/app/Assets/favicon/favicon.png', to: 'images' }, + + // ] + // }) ], resolve: {