Closed ywkim312 closed 3 months ago
@longshuicy I've merged your PR but had a question so I recreated a PR again using your branch. Here's my question. You said that you were trying to mount this config.json using helm's config map, right? But isn't this config.json needed for during the building process. If it is working with config map in the deployment stage, then where should be the mounting point of the frontend container to mount this GA KEY json file? I mean, where should I mount the config map generated json file in the container that will be created after the building process. Or maybe I don't understand it correctly
Note: I would need to change config.json
to be the javascript script and mount/execute the javascript upon fetching
config.json
is a placeholder neede during the building processconfig.json
in the nginx folder, serving as an overwrite. Detail location can be found in the dockerfile@longshuicy I've merged your PR but had a question so I recreated a PR again using your branch. Here's my question. You said that you were trying to mount this config.json using helm's config map, right? But isn't this config.json needed for during the building process. If it is working with config map in the deployment stage, then where should be the mounting point of the frontend container to mount this GA KEY json file? I mean, where should I mount the config map generated json file in the container that will be created after the building process. Or maybe I don't understand it correctly
Note: I would need to change
config.json
to be the javascript script and mount/execute the javascript upon fetching
- Yes the
config.json
is a placeholder neede during the building process- I haven't had time to create the config map PR in the incore-helm yet
- It should be mount at the exact location of
config.json
in the nginx folder, serving as an overwrite. Detail location can be found in the dockerfile
I have a PR for configmap in incore-helm so you don't need to worry. Okay, I will test with the nginx's config folder. So that is where you need to mount. What if there is config.json already in there, it will lose the information if there is any because it will override
I actually dont know what to with the "react-ga" library. Not sure I can put those logic as a javascript, so I just left it as it is.
@longshuicy I've merged your PR but had a question so I recreated a PR again using your branch. Here's my question. You said that you were trying to mount this config.json using helm's config map, right? But isn't this config.json needed for during the building process. If it is working with config map in the deployment stage, then where should be the mounting point of the frontend container to mount this GA KEY json file? I mean, where should I mount the config map generated json file in the container that will be created after the building process. Or maybe I don't understand it correctly
Note: I would need to change
config.json
to be the javascript script and mount/execute the javascript upon fetching
- Yes the
config.json
is a placeholder neede during the building process- I haven't had time to create the config map PR in the incore-helm yet
- It should be mount at the exact location of
config.json
in the nginx folder, serving as an overwrite. Detail location can be found in the dockerfileI have a PR for configmap in incore-helm so you don't need to worry. Okay, I will test with the nginx's config folder. So that is where you need to mount. What if there is config.json already in there, it will lose the information if there is any because it will override
Thanks!
Yes, if there is config.json already exist, the config will be override when deploying. We won't place any real value in the default "config.json". Isn't that the desired behavior?
@longshuicy I've merged your PR but had a question so I recreated a PR again using your branch. Here's my question. You said that you were trying to mount this config.json using helm's config map, right? But isn't this config.json needed for during the building process. If it is working with config map in the deployment stage, then where should be the mounting point of the frontend container to mount this GA KEY json file? I mean, where should I mount the config map generated json file in the container that will be created after the building process. Or maybe I don't understand it correctly
Note: I would need to change
config.json
to be the javascript script and mount/execute the javascript upon fetching
- Yes the
config.json
is a placeholder neede during the building process- I haven't had time to create the config map PR in the incore-helm yet
- It should be mount at the exact location of
config.json
in the nginx folder, serving as an overwrite. Detail location can be found in the dockerfileI have a PR for configmap in incore-helm so you don't need to worry. Okay, I will test with the nginx's config folder. So that is where you need to mount. What if there is config.json already in there, it will lose the information if there is any because it will override
Thanks!
Yes, if there is config.json already exist, the config will be override when deploying. We won't place any real value in the default "config.json". Isn't that the desired behavior?
No I don't think so, I was just curious what if there was the data already and how we handle in that situation
@longshuicy Other question is that, if you want to whole javascript block, it will not be just a simple config.json, right? Or maybe we can put the javascript values in the json's value field with given key? Anyway, I will see how you handle this.
@longshuicy This is the source of index.html. Does it look correct?
<body>
<!--StartFragment-->
| <!doctype html><html lang="en"><head><script>fetch("/config/googleAnalytics.js").then((t=>t.text())).then((t=>{const e=document.createElement("script");e.textContent=t,document.head.appendChild(e)})).catch((t=>console.error("Failed to load analytics script:",t)))</script><meta charset="utf-8"/><title>IN-CORE</title><link rel="icon" href="favicon.ico"><script defer="defer" src="main.408a5fcdcffa7d07451c.js"></script><link href="main.edc7cdc5ee8e7fcb8778.css" rel="stylesheet"></head><body><div id="app"></div></body></html
-- | --
<!--EndFragment-->
</body>
</html><!doctype html><html lang="en"><head><script>fetch("/config/googleAnalytics.js").then((t=>t.text())).then((t=>{const e=document.createElement("script");e.textContent=t,document.head.appendChild(e)})).catch((t=>console.error("Failed to load analytics script:",t)))</script><meta http-equiv="X-UA-Compatible" content="no-cache"><meta charset="utf-8"/><title>IN-CORE</title><link rel="icon" href="[favicon.ico](https://incore-dev.ncsa.illinois.edu/favicon.ico)"><script defer="defer" src="[main.408a5fcdcffa7d07451c.js](https://incore-dev.ncsa.illinois.edu/main.408a5fcdcffa7d07451c.js)"></script><link href="[main.edc7cdc5ee8e7fcb8778.css](https://incore-dev.ncsa.illinois.edu/main.edc7cdc5ee8e7fcb8778.css)" rel="stylesheet"></head><body><div id="app"></div></body></html```
@longshuicy This is the source of index.html. Does it look correct?
<body> <!--StartFragment--> | <!doctype html><html lang="en"><head><script>fetch("/config/googleAnalytics.js").then((t=>t.text())).then((t=>{const e=document.createElement("script");e.textContent=t,document.head.appendChild(e)})).catch((t=>console.error("Failed to load analytics script:",t)))</script><meta charset="utf-8"/><title>IN-CORE</title><link rel="icon" href="favicon.ico"><script defer="defer" src="main.408a5fcdcffa7d07451c.js"></script><link href="main.edc7cdc5ee8e7fcb8778.css" rel="stylesheet"></head><body><div id="app"></div></body></html -- | -- <!--EndFragment--> </body> </html><!doctype html><html lang="en"><head><script>fetch("/config/googleAnalytics.js").then((t=>t.text())).then((t=>{const e=document.createElement("script");e.textContent=t,document.head.appendChild(e)})).catch((t=>console.error("Failed to load analytics script:",t)))</script><meta http-equiv="X-UA-Compatible" content="no-cache"><meta charset="utf-8"/><title>IN-CORE</title><link rel="icon" href="[favicon.ico](https://incore-dev.ncsa.illinois.edu/favicon.ico)"><script defer="defer" src="[main.408a5fcdcffa7d07451c.js](https://incore-dev.ncsa.illinois.edu/main.408a5fcdcffa7d07451c.js)"></script><link href="[main.edc7cdc5ee8e7fcb8778.css](https://incore-dev.ncsa.illinois.edu/main.edc7cdc5ee8e7fcb8778.css)" rel="stylesheet"></head><body><div id="app"></div></body></html```
@longshuicy I checked the response and it has the value of config.json but I am not very sure if this works. I will keep checking.
@longshuicy I've merged your PR but had a question so I recreated a PR again using your branch. Here's my question. You said that you were trying to mount this config.json using helm's config map, right? But isn't this config.json needed for during the building process. If it is working with config map in the deployment stage, then where should be the mounting point of the frontend container to mount this GA KEY json file? I mean, where should I mount the config map generated json file in the container that will be created after the building process. Or maybe I don't understand it correctly