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

Add manifests #32

Merged
merged 5 commits into from
Aug 11, 2023
Merged

Add manifests #32

merged 5 commits into from
Aug 11, 2023

Conversation

bharathappali
Copy link
Member

No description provided.

@bharathappali bharathappali self-assigned this Jul 14, 2023
@bharathappali bharathappali marked this pull request as draft July 14, 2023 07:48
@bharathappali
Copy link
Member Author

@CodiumAI-Agent /review

@CodiumAI-Agent
Copy link

PR Analysis

  • 🎯 Main theme: Adding manifests for deployment and environment variables
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: No
  • Focused PR: Yes, the PR is focused as it is primarily concerned with adding manifests for deployment and setting up environment variables. However, the PR lacks a description which could provide more context about the changes.
  • 🔒 Security concerns: No, the PR does not introduce any obvious security concerns. However, it's always a good practice to ensure that environment variables and configurations do not expose sensitive information.

PR Feedback

  • 💡 General PR suggestions: The PR is generally well-structured and follows good practices. However, it would be beneficial to include a description for the PR to provide more context about the changes. Additionally, it would be good to consider adding tests to ensure the correctness of the new code.

How to use

Tag me in a comment '@CodiumAI-Agent' and add one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve: Suggest improvements to the code in the PR. These will be provided as pull request comments, ready to commit.
/ask <QUESTION>: Pose a question about the PR.

@bharathappali
Copy link
Member Author

@CodiumAI-Agent /improve

Comment on lines 1 to 2
export const KRUIZE_API_URL = process.env.KRUIZE_APP_API_URL || undefined;
export const KRUIZE_API_PORT = process.env.KRUIZE_APP_API_PORT || undefined;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: It's better to provide a default value for the environment variables in case they are not set. This can prevent potential issues of these variables being undefined.

Suggested change
export const KRUIZE_API_URL = process.env.KRUIZE_APP_API_URL || undefined;
export const KRUIZE_API_PORT = process.env.KRUIZE_APP_API_PORT || undefined;
export const KRUIZE_API_URL = process.env.KRUIZE_APP_API_URL || 'http://localhost';
export const KRUIZE_API_PORT = process.env.KRUIZE_APP_API_PORT || '8080';

@bharathappali bharathappali marked this pull request as ready for review August 8, 2023 05:54
@bhanvimenghani bhanvimenghani requested a review from dinogun August 8, 2023 06:07
@@ -0,0 +1,28 @@
FROM node:16 AS builder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this Dockerfile specific to minikube? If so why? If not please rename it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed it, Thanks for the review

deploy.sh Outdated
@@ -1,4 +1,17 @@
#!/bin/bash

export KRUIZE_UI_IMAGE="docker.io/bharathappali/kruize-ui:central-config"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be changed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to quay.io/kruize/kruize-ui:test

deploy.sh Outdated
@@ -1,4 +1,17 @@
#!/bin/bash

export KRUIZE_UI_IMAGE="docker.io/bharathappali/kruize-ui:central-config"
KRUIZE_UI_MANIFEST_FILE="kruize-ui-nginx-setup.yml"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we use envsubst to create the yaml and this is the file we update in dynamic and static folders


POD_NAME="kruize-ui-nginx-pod"
SERVICE_NAME="kruize-ui-nginx-service"
NAMESPACE="monitoring"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

monitoring is only for minikube. For openshift, we are using openshift-tuning

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have -e option which will set the namespace based on deployment platform

kruize-ui.yml Outdated
@@ -0,0 +1,42 @@
apiVersion: apps/v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file might need to be deleted

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleted

@@ -0,0 +1,68 @@
apiVersion: v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All yaml files need to use the suffix .yaml and not .yml in line with the convention that we are following in all the other repos

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed it to yaml

spec:
containers:
- name: kruize-ui-nginx-container
image: docker.io/bharathappali/kruize-ui:central-config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to kruize ui images on quay

spec:
containers:
- name: kruize-ui-nginx-container
image: bharathappali/kruize-ui:test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be updated

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to kruize ui images on quay

Comment on lines 324 to 335
// const Context = useContext(nodeContext);
// const ip = Context['cluster'];
// const port = Context['autotune'];
//
// let k_url: string;
//
// if (ip) {
// k_url = ip + ':' + port;
// } else {
// k_url = 'kruize';
// }
// const list_experiments_url = 'http://' + k_url + '/listRecommendations';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented code

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the commented code

Comment on lines 168 to 183
// const Context = useContext(nodeContext);
// const ip = Context['cluster'];
// const port = Context['autotune'];
// let k_url: string;
//
// if (ip) {
// k_url = ip + ':' + port;
// } else {
// k_url = 'kruize';
// }
// const list_recommendations_url =
// 'http://' +
// k_url +
// '/listRecommendations?experiment_name=' +
// sessionStorage.getItem('Experiment Name') +
// '&latest=false';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented code

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the commented code

Comment on lines 18 to 31
// const Context = useContext(nodeContext);
// const ip = Context['cluster'];
// const port = Context['autotune'];
// let k_url: string;
//
// if (ip) {
// k_url = ip + ':' + port;
// } else {
// k_url = 'kruize';
// }
//
// const list_recommendations_url =
// 'http://' + k_url + '/listRecommendations?experiment_name=' + props.SREdata.experiment_name + '&latest=false';
// const list_experiment_url = 'http://' + k_url + '/listExperiments';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented code

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the commented code

}
}

export { getRecommendationsURLWithParams, getListExperimentsURL, getHostname, getPort, getRecommendationsURL };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we follow the practice of adding an extra line towards the end of each file so that minus sign is not there

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the extra line, Thanks for reviewing

// const ip = Context['cluster'];
// const port = Context['autotune'];

console.log("hello");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove this console log statement as it just prints hello

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Comment on lines 15 to 17
// const Context = useContext(nodeContext);
// const ip = Context['cluster'];
// const port = Context['autotune'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove these comments as they are not relevant to the current setup

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I have removed them now, thanks for the pointer

if (isProduction) {
return window.location.port || (window.location.protocol === "https:" ? "443" : "80");
} else {
return process.env.AUTOTUNE_PORT;
Copy link
Contributor

@bhanvimenghani bhanvimenghani Aug 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change the variable name AUTOTUNE_PORT to KRUIZE_PORT everywhere to make it consistent with the terminology used in the readme and everywhere else in ui

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to KRUIZE_PORT

Clean up and update deployment files
push scripts for demo
Use non-root user nginx
Update docker file
update the k_url stuff
Update Nginx port
Update the config port

Signed-off-by: bharathappali <abharath@redhat.com>
Dockerfile.old Outdated
@@ -0,0 +1,40 @@
FROM node:16 AS builder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete this file .... dont need this for now

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted the old docker file

spec:
containers:
- name: kruize-ui-nginx-container
image: docker.io/bharathappali/kruize-ui:central-config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the right image here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These will be generated by the deploy script and I have left them unchanged after moving the kruize demos way of depployment. Will change it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the image as quay.io/kruize/kruize-ui:test

spec:
containers:
- name: kruize-ui-nginx-container
image: bharathappali/kruize-ui:test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image should be from the kruize repo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the image as quay.io/kruize/kruize-ui:test

Signed-off-by: bharathappali <abharath@redhat.com>
Signed-off-by: bharathappali <abharath@redhat.com>
Signed-off-by: bharathappali <abharath@redhat.com>
Signed-off-by: bharathappali <abharath@redhat.com>
Copy link
Contributor

@dinogun dinogun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dinogun dinogun merged commit ede2860 into kruize:mvp_demo Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants