-
Notifications
You must be signed in to change notification settings - Fork 119
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
Redesign Build Deployment Process (External) #961
Changes from 81 commits
93c2232
a80d7e4
20e1856
4a1005e
d4dad4a
02c7fc7
4aeb4a6
2531672
ea57afa
e8344e9
7f0d5f0
05551c8
cabc98a
c39b537
385bc97
273c2ca
2fdb469
91abdea
bbdaaae
5d0ca02
2e8a911
f5aae47
051ef66
6c44865
4569dfb
b562c2c
25109b3
709f3cf
4b42185
12d09ae
94c129b
0dd1245
5434914
0fd3e9d
ab399ea
91c0c1f
acecf3e
e778b3f
a0190d4
776f0b9
17ac3cc
706f74c
d724fd1
e6a2d79
4b3dfdf
f033f06
1207d79
f306e8c
00d9565
f182790
f1869ab
8f05955
912bd34
738b629
7102508
3d77439
a0f2424
9fb0e5a
18a8872
53015c7
41a410c
7405ff1
cd62247
ebc8188
41ae79f
290b0fc
29869cd
38209ef
da485c2
e6b388b
bb03c42
cf50d17
6a21f5d
b961417
a245e7d
2067055
3000758
6a8a13f
fc183cb
51e16de
7ab37b6
727c00c
7f1be92
7177e71
168ef10
3dea305
a0f0c6a
10624a6
0fe9476
11d2a89
4cc4c58
357d4b8
b6f59b0
ec38835
1a0d451
2fe0816
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"intake.segmentation.section_segmentation.sectionValidityAssertions": true, | ||
"intake.cleaning.clean_and_resample.speedDistanceAssertions": false, | ||
"intake.cleaning.clean_and_resample.sectionValidityAssertions": false, | ||
"intake.cleaning.filter_accuracy.enable": false, | ||
"classification.inference.mode.useAdvancedFeatureIndices": true, | ||
"classification.inference.mode.useBusTrainFeatureIndices": true, | ||
"classification.validityAssertions": true, | ||
"output.conversion.validityAssertions": true, | ||
"section.startStopRadius": 150, | ||
"section.endStopRadius": 150, | ||
"analysis.result.section.key": "analysis/inferred_section", | ||
"userinput.keylist": ["manual/mode_confirm", "manual/purpose_confirm", "manual/replaced_mode", "manual/trip_user_input", "manual/place_user_input"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
import json | ||
import os | ||
|
||
def get_config_data(): | ||
try: | ||
print("Trying to open debug.conf.json") | ||
config_file = open('conf/analysis/debug.conf.json') | ||
Comment on lines
+6
to
7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not fully convinced that this is the right approach. If we keep this backwards compat code around forever, we don't have any motivation for people to change to the new structure in the future. Having said that, I will not hold up the merge for this, but I do want to make sure that we have a plan to remove this in a year or so, and to notify users to change their config files, so that we don't end up with a bunch of hacky backwards compat code strewn all around the codebase. |
||
except: | ||
print("analysis.debug.conf.json not configured, falling back to sample, default configuration") | ||
config_file = open('conf/analysis/debug.conf.json.sample') | ||
if os.getenv("PROD_STAGE") == "TRUE": | ||
print("In production environment, opening internal debug.conf") | ||
config_file = open('conf/analysis/debug.conf.prod.json') | ||
else: | ||
print("analysis.debug.conf.json not configured, falling back to sample, default configuration") | ||
config_file = open('conf/analysis/debug.conf.dev.json') | ||
ret_val = json.load(config_file) | ||
config_file.close() | ||
return ret_val | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import json | ||
import logging | ||
import os | ||
|
||
def get_config_data_from_env(): | ||
config_data_env = { | ||
"timeseries": { | ||
"url": os.getenv('DB_HOST', "localhost"), | ||
"result_limit": os.getenv('DB_TS_RESULT_LIMIT', 250000) | ||
} | ||
} | ||
return config_data_env | ||
|
||
def get_config_data(): | ||
try: | ||
config_file = open('conf/storage/db.conf') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also don't think we need this given that we are going to use the environment variable going forward and it falls back to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should also remove the sample file to avoid confusion since we don't use it. Note that before this change, we used to fall back to the sample file if the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Our logic here was that we wanted to maintain the functionality of db.conf for users running the server locally, in case they have it set in a certain way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would be fine with retaining this for now as a backwards compat hack but it should be removed in the next release. |
||
ret_val = json.load(config_file) | ||
config_file.close() | ||
except: | ||
ret_val = get_config_data_from_env() | ||
if ret_val["timeseries"]["url"] == "localhost": | ||
print("storage not configured, falling back to sample, default configuration") | ||
return ret_val | ||
|
||
config_data = get_config_data() | ||
|
||
def get_config(): | ||
return config_data | ||
|
||
def reload_config(): | ||
global config_data | ||
config_data = get_config_data() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,27 +51,17 @@ | |
import emission.storage.timeseries.cache_series as esdc | ||
import emission.core.timer as ect | ||
import emission.core.get_database as edb | ||
import emission.net.api.config as enac | ||
|
||
try: | ||
config_file = open('conf/net/api/webserver.conf') | ||
except: | ||
logging.debug("webserver not configured, falling back to sample, default configuration") | ||
config_file = open('conf/net/api/webserver.conf.sample') | ||
|
||
OPENPATH_URL="https://www.nrel.gov/transportation/openpath.html" | ||
STUDY_CONFIG = os.getenv('STUDY_CONFIG', "stage-program") | ||
|
||
config_data = json.load(config_file) | ||
config_file.close() | ||
static_path = config_data["paths"]["static_path"] | ||
python_path = config_data["paths"]["python_path"] | ||
server_host = config_data["server"]["host"] | ||
server_port = config_data["server"]["port"] | ||
socket_timeout = config_data["server"]["timeout"] | ||
log_base_dir = config_data["paths"]["log_base_dir"] | ||
auth_method = config_data["server"]["auth"] | ||
aggregate_call_auth = config_data["server"]["aggregate_call_auth"] | ||
not_found_redirect = config_data["paths"].get("404_redirect", OPENPATH_URL) | ||
enac.reload_config() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we reload the config only here and nowhere else? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The STUDY_CONFIG environment variable is pulled directly above, so changing this value and reloading allows testers/users to set the variable to different configs in the container using export and test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This statement doesn't answer my question. I asked why the config is reloaded here and not anywhere else.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nataliejschultz the screenshot is not loading for me (see screenshot below). We weren't re-loading the config before and the tests passed. I really don't see any reason why the config needs to be reloaded. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@shankari here is the screenshot
|
||
static_path = enac.get_config()["static_path"] | ||
server_host = enac.get_config()["server_host"] | ||
server_port = enac.get_config()["server_port"] | ||
socket_timeout = enac.get_config()["socket_timeout"] | ||
auth_method = enac.get_config()["auth_method"] | ||
aggregate_call_auth = enac.get_config()["aggregate_call_auth"] | ||
not_found_redirect = enac.get_config()["not_found_redirect"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this ever tested? I don't think that it would have ever worked.
And we didn't modify the path before returning it
|
||
|
||
BaseRequest.MEMFILE_MAX = 1024 * 1024 * 1024 # Allow the request size to be 1G | ||
# to accomodate large section sizes | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import json | ||
import logging | ||
import os | ||
|
||
def get_config_data_from_env(): | ||
config_data_env = { | ||
"static_path": os.getenv('WEB_SERVER_STATIC_PATH', "webapp/www/"), | ||
"server_host": os.getenv('WEB_SERVER_HOST', "0.0.0.0"), | ||
"server_port": os.getenv('WEB_SERVER_PORT', "8080"), | ||
"socket_timeout": os.getenv('WEB_SERVER_TIMEOUT', "3600"), | ||
"auth_method": os.getenv('WEB_SERVER_AUTH', "skip"), | ||
"aggregate_call_auth": os.getenv('WEB_SERVER_AGGREGATE_CALL_AUTH', "no_auth"), | ||
"not_found_redirect": os.getenv('WEB_SERVER_REDIRECT_URL', "https://www.nrel.gov/transportation/openpath.html") | ||
} | ||
return config_data_env | ||
|
||
|
||
def get_config_data(): | ||
try: | ||
config_file = open('conf/net/api/webserver.conf') | ||
ret_val = json.load(config_file) | ||
config_file.close() | ||
except: | ||
# if check_unset_env_vars(): | ||
logging.debug("webserver not configured, falling back to sample, default configuration") | ||
ret_val = get_config_data_from_env() | ||
return ret_val | ||
|
||
config_data = get_config_data() | ||
|
||
def get_config(): | ||
return config_data | ||
|
||
def reload_config(): | ||
global config_data | ||
config_data = get_config_data() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need the
tag_file.txt
to be uploaded here given that we are passing it directly to the workflows on line 77?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See Mukul's comment in the issue:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the issue here. You have to deal with dispatch and push separately anyway - one of them will have the image tag and the other will not. And given that we have the
.env
file checked in now, the push can just use that directly. I don't see why we need Yet Another file being uploaded from the workflow. Having said that, I am not going to hold up this PR for this, but it needs to be addressed as a polishing change.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do see now why we do not need the artifact for the push event. Detailed comments made here in public-dash Redesign PR. The comments talk about the corresponding artifact download in the dashboard repos and the explanation is applicable to the upload artifact on the server side as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MukuFlash03 I utilize the artifacts to get the tags to the internal repo, so please don't remove them yet!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nataliejschultz For now, I've tested removing only the
Download artifacts
step in the public-dashboard workflow.I don't think it is related to the
Upload artifacts
step that you added for internal repo.Neither am I making changes to the server workflow.
Can you please confirm if in this case it is alright to remove the artifact dealing with Push event from the dashboard workflows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MukuFlash03 sorry, I misunderstood what you were changing. It is okay with me to remove the
download artifacts
step!