Skip to content

Commit

Permalink
Merge pull request #84 from airavata-courses/kubesystem_v3
Browse files Browse the repository at this point in the history
Kubesystem v3
  • Loading branch information
bobbyrathoree authored Mar 19, 2020
2 parents a4dc715 + 49c8cb8 commit 368a5a8
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 20 deletions.
6 changes: 6 additions & 0 deletions reset_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ kubectl delete svc manager-svc
kubectl delete svc session-manager-svc
kubectl delete svc data-retrieval-svc
kubectl delete svc model-execution-svc
kubectl delete svc postprocessor-svc
kubectl delete svc user-interface-svc
kubectl delete svc user-server-svc
echo -e "All services deleted.\n"

kubectl delete deployment manager
kubectl delete deployment session-manager
kubectl delete deployment data-retrieval
kubectl delete deployment model-execution
kubectl delete deployment postprocessor
kubectl delete deployment user-interface
kubectl delete deployment user-server
echo "All deployments and pods deleted."
2 changes: 1 addition & 1 deletion services/manager/deployment/manager-deployment.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
initialDelaySeconds: 30
timeoutSeconds: 5
command: ["/bin/sh", "-c"]
args: ["wget -O /manager/api_manager/firestore/pubsub-firestore-development.json https://www.dropbox.com/s/51l60y245m60nt1/pubsub-firestore-development.json?dl=1; gunicorn -c gconf.py manager.wsgi"]
args: ["wget -O /manager/api_manager/firestore/pubsub-firestore-development.json https://www.dropbox.com/s/jm7o4s8a0ekdn7d/pubsub-firestore-development.json?dl=1; gunicorn -c gconf.py manager.wsgi"]
env:
{%- for item in manager_envs %}
- name: {{ item }}
Expand Down
2 changes: 1 addition & 1 deletion services/manager/deployment/production_jinja.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"POSTGRES_PASSWORD": "EI6dbPfDn6jCBnOn",
"POSTGRES_HOST": "35.222.109.219",
"POSTGRES_PORT": "\"5432\"",
"REDIS_HOST": "redis://scrumlords-weather-redis-ha.default.svc.cluster.local:6379",
"REDIS_HOST": "redis://:L9l9Sup9Vl@scrumlords-weather-redis-master.default.svc.cluster.local:6379",
"PUBSUB_PROJECT_ID": "weather-forecast-266119",
"DATA_RETRIEVAL_TOPIC": "data_retrieval",
"DATA_RETRIEVAL_ENDPOINT": "https://retrieval.bobbyrathore.com/dark/history",
Expand Down
2 changes: 1 addition & 1 deletion services/model_execution/deployment/production_jinja.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"DJANGO_ENV": "development",
"DARK_SKY_API_KEY": "6f6ba60da918163a0ad9753222977026",
"PUBSUB_PROJECT_ID": "weather-forecast-266119",
"REDIS_HOST": "redis://scrumlords-weather-redis-ha.default.svc.cluster.local:6379",
"REDIS_HOST": "redis://:L9l9Sup9Vl@scrumlords-weather-redis-master.default.svc.cluster.local:6379",
"UPDATE_STATUS_TOPIC": "update_status",
"UPDATE_STATUS_ENDPOINT": "https://manager.bobbyrathore.com/session/status",
"UPDATE_SESSION_TOPIC": "update_session",
Expand Down
6 changes: 3 additions & 3 deletions services/postprocessor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:8-jdk-alpine
FROM openjdk:8

ENV INSTALL_PATH /postprocessor

Expand All @@ -8,7 +8,7 @@ WORKDIR $INSTALL_PATH

ADD . /postprocessor

RUN apk update && apk add maven wget \
&& wget -O /postprocessor/src/main/resources/pubsub-firestore-development.json https://www.dropbox.com/s/51l60y245m60nt1/pubsub-firestore-development.json?dl=1
RUN apt-get update && apt-get -y install maven wget \
&& wget -O /postprocessor/src/main/resources/pubsub-firestore-development.json https://www.dropbox.com/s/jm7o4s8a0ekdn7d/pubsub-firestore-development.json?dl=1

WORKDIR $INSTALL_PATH
2 changes: 1 addition & 1 deletion services/session_manager/deployment/production_jinja.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"DJANGO_ENV": "development",
"PUBSUB_EMULATOR_HOST": "localhost:8085",
"PUBSUB_PROJECT_ID": "weather-forecast-266119",
"REDIS_HOST": "redis://scrumlords-weather-redis-ha.default.svc.cluster.local:6379",
"REDIS_HOST": "redis://:L9l9Sup9Vl@scrumlords-weather-redis-master.default.svc.cluster.local:6379",
"GOOGLE_APPLICATION_CREDENTIALS": "./manager/firestore/pubsub-firestore-development.json",
"BIND_ON": "0.0.0.0:8100"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
initialDelaySeconds: 30
timeoutSeconds: 5
command: ["/bin/sh", "-c"]
args: ["wget -O /session_manager/manager/firestore/pubsub-firestore-development.json https://www.dropbox.com/s/51l60y245m60nt1/pubsub-firestore-development.json?dl=1; gunicorn -c gconf.py session_manager.wsgi"]
args: ["wget -O /session_manager/manager/firestore/pubsub-firestore-development.json https://www.dropbox.com/s/jm7o4s8a0ekdn7d/pubsub-firestore-development.json?dl=1; gunicorn -c gconf.py session_manager.wsgi"]
env:
{%- for item in session_manager_envs %}
- name: {{ item }}
Expand Down
18 changes: 16 additions & 2 deletions services/user_interface/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,26 @@ import setAuthToken from './utils/setAuthToken'
import { loadUser } from './actions/auth';
import './css/weather.css'



if (localStorage.token) {
setAuthToken(localStorage.token);
}

// Allow Cross-Origin requests
let cors_api_host = 'cors-anywhere.herokuapp.com';
let cors_api_url = 'https://' + cors_api_host + '/';
let slice = [].slice;
let origin = window.location.protocol + '//' + window.location.host;
let open = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function () {
let args = slice.call(arguments);
let targetOrigin = /^https?:\/\/([^\/]+)/i.exec(args[1]);
if (targetOrigin && targetOrigin[0].toLowerCase() !== origin &&
targetOrigin[1] !== cors_api_host) {
args[1] = cors_api_url + args[1];
}
return open.apply(this, args);
};

const App = () => {

useEffect(() => {
Expand Down
8 changes: 4 additions & 4 deletions services/user_interface/src/components/auth/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function Copyright() {
return (
<Typography variant="body2" color="textSecondary" align="center">
{'Copyright © '}
<Link color="inherit" href="#">
Weather-io
<Link color="inherit" href="https://github.com/airavata-courses/ScrumLords">
ScrumLords
</Link>{' '}
{new Date().getFullYear()}
{'.'}
Expand All @@ -38,7 +38,7 @@ const useStyles = makeStyles(theme => ({
},
form: {
width: '100%', // Fix IE 11 issue.
marginTop: theme.spacing(4),
marginTop: theme.spacing(7),
},
submit: {
background: '#5e5e5e',
Expand Down Expand Up @@ -96,7 +96,7 @@ const Login = (props) => {
<Avatar className={classes.avatar}>
</Avatar>
<Typography component="h1" variant="h6" className={classes.header} color="textSecondary">
Welcome to Weather-io
ScrumLords - Weather
</Typography>
<form className={classes.form} onSubmit={e => onSubmit(e)}>
<TextField
Expand Down
5 changes: 3 additions & 2 deletions services/user_interface/src/components/auth/Register.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function Copyright() {
return (
<Typography variant="body2" color="textSecondary" align="center">
{'Copyright © '}
<Link color="inherit" href="https://material-ui.com/">
Weather.io
<Link color="inherit" href="https://github.com/airavata-courses/ScrumLords">
ScrumLords
</Link>{' '}
{new Date().getFullYear()}
</Typography>
Expand Down Expand Up @@ -82,6 +82,7 @@ const Register = (props) => {
};

if (props.isAuthenticated) {
alert('Registe Success!')
return <Redirect to='/dashboard' />
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const WeatherContainer = () => {
}
*/

fetch(`http://api.openweathermap.org/data/2.5/weather?q=${searchQuery1},${searchQuery2},us&units=imperial&appid=${API_KEY}`)
fetch(`https://api.openweathermap.org/data/2.5/weather?q=${searchQuery1},${searchQuery2},us&units=imperial&appid=${API_KEY}`)
.then(res => res.json())
.then(async data => {

Expand Down
2 changes: 1 addition & 1 deletion services/user_server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion services/user_server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"start": "node server",
"server": "nodemon server",
"client": "npm start --prefix ../user_interface/client",
"client": "npm start --prefix ../user_interface",
"dev": "concurrently \"npm run server\" \"npm run client\""
},
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"weather_data_retrieval_envs": {
"DJANGO_ENV": "development",
"DARK_SKY_API_KEY": "6f6ba60da918163a0ad9753222977026",
"REDIS_HOST": "redis://scrumlords-weather-redis-ha.default.svc.cluster.local:6379",
"REDIS_HOST": "redis://:L9l9Sup9Vl@scrumlords-weather-redis-master.default.svc.cluster.local:6379",
"PUBSUB_PROJECT_ID": "weather-forecast-266119",
"MODEL_EXECUTE_TOPIC": "model_execute",
"MODEL_EXECUTE_ENDPOINT": "https://model.bobbyrathore.com/dark/forecast",
Expand Down

0 comments on commit 368a5a8

Please sign in to comment.