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

Redesign Build Deployment Process (External) #961

Merged
merged 96 commits into from
Aug 12, 2024

Commits on Mar 21, 2024

  1. Read secret_list from actual file if present, else use sample file.

    Added a try-catch block similar to how other config files are used in case where actual non-sample file is present else use the sample file.
    
    Can remove the file from internal repo since not needed anymore.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Mar 21, 2024
    Configuration menu
    Copy the full SHA
    93c2232 View commit details
    Browse the repository at this point in the history

Commits on Mar 26, 2024

  1. Matched conf/log files with internal repo

    Changed level to DEBUG and formatter set to detailed.
    
    Can keep both external and internal versions same by making external also have the same logging level as internal.
    
    Internal version given priority as detailed logging is better for detecting errors.
    
    Also, debug() statements [~1500] are much more than warning() statements [~50].
    
    Will lose out on all these when external repo is used / run if only WARNING level set as default which is higher than DEBUG level.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    a80d7e4 View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2024

  1. Reading push.json values from environment variables

    Push.json.sample just has 4 key-value pairs which can be changed to ENV variables internally.
    
    Hence, need to write code to read from Env variables.
    
    Changing emission/net/ext_service/push/notify_interface.py to read from env variables.
    
    Using helper class config.py, based on existing template.
    
    First reading from .json file if exists, else read from env variables.
    If env variables are all None, then say that values not configured.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    20e1856 View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2024

  1. Choose analysis/debug.conf file based on ENV var

    Added new environment variable PROD_STAGE.
    
    If this is set to TRUE, then the debug.conf.internal.json will be selected as the conf file.
    
    Else, the existing try-catch block is executed which either checks for a debug.conf.json or uses the sample file if the former does not exist.
    
    The try part is still valid, since some Test files copy over the sample file as debug.conf.json, then reload the config in eac.reload_config() which would need reading from debug.conf.json as well.
    
    Hence, now three files exist:
    - debug.conf.json.sample
    - debug.conf.json
    - debug.conf.json.internal
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    4a1005e View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2024

  1. Testing method to share tag between repos

    This is the first part of the method to share the server image tag between other repositories. It would be shared as tag.txt, which gets overwritten every time the image build runs.
    nataliejschultz committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    d4dad4a View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2024

  1. Changed webserver.conf.json to Environment variables + Removed sed / …

    …jq from docker_start_script.sh
    
    Summary:
    Currently replaced config file values with environment variables.
    Expecting developers to manually set env vars instead of conf files.
    So, for instance, running containers using `docker-compose` or `docker run`, need to set these values similarly like push environment variables will need to be set.
    
    Key-value pairs in the webserver config file:
    REMOVED: log_base_dir, python_path, log_file
    ENV: static_path, 404_redirect, host, port, timeout, auth, aggregate_call_auth
    
    ———————————
    
    Changes
    
    1. webserver.conf.sample
    - Kept file as it is and changed how values being read in cfc_webapp.py, TestWebserver.py and docker_start_script.sh
    
    2. TestWebserver.py
    - In setup(): Storing current original ENV variables, Replacing them with test values
    - In teardown(): Restoring original ENV variables
    
    3. cfc_webapp.py
    - Removed log_base_dir, python_path, log_file as these were only used in the cfc_webapp.py to read in the value from the config file and not used elsewhere.
    - Added environment variables for the other config key-value pairs to avoid dependence on config file and as they were being used in the cfc_webapp.py file.
    
    4. docker_start_script.sh - Removed sed / jq usage for editing webserver.conf.sample.json file and copying over as webserver.conf.json; simply setting the environment variable for WEB_SERVER_HOST now.
    
    -------------------
    
    Special notes:
    
    1. config.json <-> webserver.conf.sample.json
    - Some files still use config.json and these changes were made 7-8 years ago (even 10 years ago). This config.json file has the same contents as the current webserver.conf.sample.
    - So, webserver.conf.sample.json was actually config.json at some point!
    e-mission@a028dec
    
    2. Sed localhost replacement isn’t functionally correct
    - The default sample value for server.host is "0.0.0.0".
    - But the sed command replaces “localhost” with the ENV variable value.
    - Since the localhost keyword itself isn’t there in the sample file, the replacement will not work either.
    
    ----------------
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    02c7fc7 View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2024

  1. Corrected logic to set test webserver ENV variables

    Initially, was setting them in the if block if ENV variables already existed.
    It wasn’t being set as if condition was being evaluated as False.
    But if condition should be mainly to store existing values.
    In any case, test values must be set, hence moving it outside if block.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    4aeb4a6 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2024

  1. Changed Webserver.conf + Db.conf to Environment variable + Removed se…

    …d / jq use
    
    Details of files changed
    
    1. Start scripts
    .docker/docker_start_script.sh
    emission/integrationTests/start_integration_tests.sh
    setup/tests/start_script.sh
    
    - Changed seq / jq usage to directly set Environment variable to desired value; no need of saving sample file as actual conf json file.
    
    2. Config.py files
    emission/core/config.py
    emission/net/api/config.py
    emission/net/ext_service/push/config.py
    
    - Based this file on emission/analysis/config.py
    - Added these to read from conf files if present or environment variables instead of sample files.
    - Default values set are taken from sample files.
    - check_unset_env_vars() can be used to check whether ALL environment variables are unset.
    
    3. DB, Webapp, Push application usage files
    emission/core/get_database.py
    emission/net/api/cfc_webapp.py
    emission/net/ext_service/push/notify_interface.py
    
    - Changed logic to read using the config.py files that read the non-sample actual config files if present or from the Environment variables instead of sample files.
    
    4. Test Files
    emission/integrationTests/storageTests/TestMongodbAuth.py
    emission/tests/netTests/TestWebserver.py
    emission/tests/netTests/TestPush.py
    
    - Test files that exercise the functionality of the logic in the files in (3).
    - Earlier, config files were being replaced with test values and copied over for testing purposes.
    - Now, switching to using environment variables - call sent to config files in (2) indirectly via application usage files in (3)
    - Following flow is followed in reading from and restoring original environment variables values
    	setup()
            - Sets ENV vars by storing original vars if set, then uses test ENV vars as new values
    	TestFunc()
            - importing modules named in (3) causes values to be read in, which now reads in newer test values since they set the ENV vars in setup()
            - only those ENV vars in test values are set; unchanged ones left untouched or default values read using os.getenv(var name, default)
    	teardown()
            - Unset test ENV vars by using del os.environ[var_name]
            - Restore original values from original dict
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    2531672 View commit details
    Browse the repository at this point in the history
  2. Reverting Natalie testing artifact changes + Adding image-push-merge

    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    ea57afa View commit details
    Browse the repository at this point in the history
  3. Fixes for failing TestTokenQueries print assertions

    test_run_script_empty () and test_run_script_show() were failing
    - Was occurring because I had used logging.debug() instead of print()
    - Hence std output stream was unable to get the print(“storage not configured”) statement
    
    Some more fixes:
    - db.conf incorrectly read instead of webserver.conf in config.py in emisison/net/api
    - TestPush had an incomplete test, that was used just for testing purposes to invoke calls on importing the pni module.
    - TestWebserver.py changed print() statements to logging.debug()
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    e8344e9 View commit details
    Browse the repository at this point in the history
  4. Fixes for failing TestTokenQueries print assertions

    Assertion Error this time in another CI GitHub actions
    Workflow name : test-with-docker
    
    Succeeded earlier when the other test (ubuntu-only-test-with-manual-install) failed:
    https://github.com/e-mission/e-mission-server/actions/runs/8658279606/job/23741854476
    
    - This happened since then “storage not configured” wasn’t being printed, which is what the test wants as docker compose is used to set up mongo db container.
    - With docker, localhost becomes db as the DB_HOST ENV var or “url” key-value.
    
    SOLVED
    - Added if condition to print “storage not configured” only when url value is till equal to sample value “localhost”
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    7f0d5f0 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2024

  1. Try-except block brought to the top

    Will first check if debug.conf exists, like other conf files.
    If it does not, except block then check if PROD_STAGE environment variable is set and whether debug.conf.internal is present.
    Else, fall back to sample conf.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    05551c8 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #2 from MukuFlash03/consolidate-differences

    Try-except block brought to the top
    MukuFlash03 authored Apr 16, 2024
    Configuration menu
    Copy the full SHA
    cabc98a View commit details
    Browse the repository at this point in the history
  3. Removed extraneous seed_model.json

    Accidentally added this after running all tests.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    c39b537 View commit details
    Browse the repository at this point in the history
  4. Merge pull request #3 from MukuFlash03/consolidate-differences

    Removed extraneous seed_model.json
    MukuFlash03 authored Apr 16, 2024
    Configuration menu
    Copy the full SHA
    385bc97 View commit details
    Browse the repository at this point in the history

Commits on Apr 24, 2024

  1. TODO added to change to master branch in YML file

    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    273c2ca View commit details
    Browse the repository at this point in the history
  2. Adding image-push-merge branch to automated CI/CD tests

    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    2fdb469 View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2024

  1. Upload artifact test - 1

    Removed test workflow execution.
    Added upload artifact.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    91abdea View commit details
    Browse the repository at this point in the history
  2. Upload artifact test - 2

    Commented image build and push for testing purposes.
    Fixed indentation.
    Learnt that YAML do not permit using tabs as indentation; spaces allowed.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    bbdaaae View commit details
    Browse the repository at this point in the history
  3. Added temporary test file

    Temporary test file while working on automating tags modification.
    Checking to see if new artifacts generated even if overwrite is set to true.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    5d0ca02 View commit details
    Browse the repository at this point in the history
  4. Changes to actions + echo

    Trying to build an image off this branch instead of the other branch, so that testing is more relevant to the changes on consolidate-differences.
    nataliejschultz committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    2e8a911 View commit details
    Browse the repository at this point in the history
  5. Upload artifact test - 3

    Storing actual required tag with date timestamp.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    f5aae47 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2024

  1. Repository dispatch send - 1

    Checked out from image-push-merge branch which has artifact method working.
    - Changed trigger branch on push to tags-dispatch
    - Dispatching repository event from server so that join page repo's workflow will be triggered.
    - Once this dispatch method works, might not even need artifacts since repository dispatch has a client_payload option to pass data.
    - This is helpful since only 500 artifacts are allowed in any repo:
    https://github.com/actions/upload-artifact#:~:text=has%20a%20limit-,of%20500%20artifacts.,-For%20assistance%20with
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    051ef66 View commit details
    Browse the repository at this point in the history
  2. Workflow dispatch send - 1

    Trying with workflow dispatch.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    6c44865 View commit details
    Browse the repository at this point in the history
  3. Workflow dispatch send - 2

    Removing failed inputs
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    4569dfb View commit details
    Browse the repository at this point in the history
  4. Workflow dispatch send - 3

    Testing triggering workflow dispatch again.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    b562c2c View commit details
    Browse the repository at this point in the history
  5. Workflow dispatch send - 3

    Changed branch name to new branch so it picks workflow events in join from this branch.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    25109b3 View commit details
    Browse the repository at this point in the history
  6. Workflow dispatch send - 4

    Testing if working with updated token scopes to have only actions: write
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    709f3cf View commit details
    Browse the repository at this point in the history
  7. Workflow dispatch send - 5

    Testing sending docker image tags as input values in the POST request.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    4b42185 View commit details
    Browse the repository at this point in the history
  8. Workflow dispatch send - 6

    Sending actual date timestamp which is used as a suffix to the docker image tag.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    12d09ae View commit details
    Browse the repository at this point in the history
  9. Workflow dispatch send - 7

    Removed code related to artifact method for sending docker image tags.
    Workflow dispatch uses POST request via which input data values can be sent to the repository in which the workflow is to be triggered.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    94c129b View commit details
    Browse the repository at this point in the history
  10. Matrix build send - 1

    Copied over YAML file from e-mission-server repo after successfully implementing transmission of docker image tags from e-mission-server to join with artifacts and workflow dispatch.
    
    Added another dispatch job to trigger workflow via matrix strategy.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    0dd1245 View commit details
    Browse the repository at this point in the history
  11. Matrix build send - 2

    Updated branch name which was set for the workflow dispatch without matrix build.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    5434914 View commit details
    Browse the repository at this point in the history
  12. Matrix build send - 3

    Jobs completed successfully but nothing happens in the other three target repos.
    
    I observed in real-time that the matrix jobs - "dispatch”, start before or at the same time the main build job and get over really quickly.
    Hence, the error makes sense as the docker image tag is not generated yet:
    
    {
      "message": "Required input 'docker_image_tag' not provided",
      "documentation_url": "https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event"
    }
    
    Hence,  the timeout-minutes parameter makes sense to use as was mentioned in the blog post:
    https://www.amaysim.technology/blog/using-github-actions-to-trigger-actions-across-repos
    
    5 minutes seems too much, I’ll give it a minute for now.
    
    Alternatively, timeout not needed; can use "needs" similar to how fetch_run_id job was run first before trying to download artifact.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    0fd3e9d View commit details
    Browse the repository at this point in the history
  13. Matrix build send - 3

    Since the date is being generated in a different jobs, must access it using needs keyword.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    ab399ea View commit details
    Browse the repository at this point in the history
  14. Matrix build send - 4

    Properly added date by setting it as an output value of the 1st build job.
    Then storing it as an environment variable in the 2nd job by accessing it via the needs keyword.
    Finally using it in the curl POST request by referencing the environment variable.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    91c0c1f View commit details
    Browse the repository at this point in the history
  15. Matrix build send - 5

    Editing sample file as a sanity check to see if matrix build works.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    acecf3e View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2024

  1. Fix for "url" KeyError observed in public-dash redesign testing

    The bug was triggered by a .gitignore-d conf/ directory in public-dash which had a db.conf file.
    This was being loaded when docker-compose.dev.yml was used to test the dev version of public-dash.
    
    This was occurring since there was a nested dictionary in the db.conf.sample and db.conf files while I had initially only stored the nested keys (url, result_limit). Since it was still reading from the file, it stored the nested dictionary format with timeseries as the parent key followed by (url, result_limit) as children.
    
    Hence, fixing it by adding the same nested dictionary structure in the emission/core/config.py and emission/core/get_database.py
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    e778b3f View commit details
    Browse the repository at this point in the history
  2. Fix for "url" KeyError observed in public-dash redesign testing

    The bug was triggered by a .gitignore-d conf/ directory in public-dash which had a db.conf file.
    This was being loaded when docker-compose.dev.yml was used to test the dev version of public-dash.
    
    This was occurring since there was a nested dictionary in the db.conf.sample and db.conf files while I had initially only stored the nested keys (url, result_limit). Since it was still reading from the file, it stored the nested dictionary format with timeseries as the parent key followed by (url, result_limit) as children.
    
    Hence, fixing it by adding the same nested dictionary structure in the emission/core/config.py and emission/core/get_database.py
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    a0190d4 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2024

  1. Artifact + Matrix - 1

    Added build and push to have latest image available in docker hub that is generated with updated YAML file.
    Removed join repo from workflow dispatch.
    
    Added artifact so that this can be used in case of push trigger event in admin-dash and public-dash repos with the help of the python script fetch_runID.py in those repos, to get the latest run_ID for a specific branch with the artifact.
    
    Workflow dispatch would still use the input parameters which contains the latest timestamp tag.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed May 2, 2024
    Configuration menu
    Copy the full SHA
    776f0b9 View commit details
    Browse the repository at this point in the history
  2. Artifact + Matrix - 2

    Changed branch name to tags-combo-approach; resulted in a failed workflow in admin-dash, public-dash since branch was still set to tags-matrix.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed May 2, 2024
    Configuration menu
    Copy the full SHA
    17ac3cc View commit details
    Browse the repository at this point in the history
  3. Artifact + Matrix - 3

    Changing step name to exclude join-page; included earlier for testing purposes but now focussing on the dashboard repos which actually use the server as the base image and hence need the workflow to be triggered.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed May 2, 2024
    Configuration menu
    Copy the full SHA
    706f74c View commit details
    Browse the repository at this point in the history
  4. Revert "Adding image-push-merge branch to automated CI/CD tests"

    This reverts commit 2fdb469.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed May 2, 2024
    Configuration menu
    Copy the full SHA
    d724fd1 View commit details
    Browse the repository at this point in the history
  5. Revert "TODO added to change to master branch in YML file"

    This reverts commit 273c2ca.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed May 2, 2024
    Configuration menu
    Copy the full SHA
    e6a2d79 View commit details
    Browse the repository at this point in the history
  6. Merge branch 'image-push-merge' into tags-combo-approach

    Including the changes for the bug fix for the url KeyError for db.conf.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed May 2, 2024
    Configuration menu
    Copy the full SHA
    4b3dfdf View commit details
    Browse the repository at this point in the history

Commits on May 3, 2024

  1. Added TODOs in github actions workflow YAML file

    Reminder for things to change as per master branch of e-mission-server once changes are finalized.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed May 3, 2024
    Configuration menu
    Copy the full SHA
    f033f06 View commit details
    Browse the repository at this point in the history
  2. Artifact + Matrix - 4

    Adding extra words to TODO just to trigger a workflow dispatch run and check if .env commit action works successfully for this trigger type too.
    Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed May 3, 2024
    Configuration menu
    Copy the full SHA
    1207d79 View commit details
    Browse the repository at this point in the history

Commits on May 6, 2024

  1. Configuration menu
    Copy the full SHA
    f306e8c View commit details
    Browse the repository at this point in the history
  2. Merge pull request #4 from MukuFlash03/tags-combo-approach

    Image tag passing with matrix strategy + artifact method
    nataliejschultz authored May 6, 2024
    Configuration menu
    Copy the full SHA
    00d9565 View commit details
    Browse the repository at this point in the history

Commits on May 9, 2024

  1. Cleanup changes

    Getting the server changes ready for merge. I modified the yml jobs to run on master again, since this was switched off for testing.  This might trigger a cascade of events, and I think we all the other PRs are ready so we can see if their jobs are triggered too.
    nataliejschultz committed May 9, 2024
    Configuration menu
    Copy the full SHA
    f182790 View commit details
    Browse the repository at this point in the history
  2. Update image_build_push.yml

    re-add run on gis-based-mode-detection branch
    nataliejschultz authored May 9, 2024
    Configuration menu
    Copy the full SHA
    f1869ab View commit details
    Browse the repository at this point in the history
  3. More cleanup + testing image build?

    Trying to trigger image_build_push.yml and removing more push triggers on other branches.
    nataliejschultz committed May 9, 2024
    Configuration menu
    Copy the full SHA
    8f05955 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2024

  1. Hardcoded webhost

    Changes to set the webhost to 0.0.0.0 at all times
    nataliejschultz committed May 16, 2024
    Configuration menu
    Copy the full SHA
    912bd34 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2024

  1. secret.py

    Removing the duplicate section
    nataliejschultz committed May 17, 2024
    Configuration menu
    Copy the full SHA
    738b629 View commit details
    Browse the repository at this point in the history
  2. Restore intake.conf.sample

    Reverting the logging level to WARNING
    nataliejschultz authored May 17, 2024
    Configuration menu
    Copy the full SHA
    7102508 View commit details
    Browse the repository at this point in the history
  3. Reverting webserver.conf.sample

    Restoring to WARNING logging level
    nataliejschultz authored May 17, 2024
    Configuration menu
    Copy the full SHA
    3d77439 View commit details
    Browse the repository at this point in the history
  4. Removing check_unset_env_vars

    Removing the functionality of check_unset_env_vars. DB_HOST should be caught in start_script.sh. When I rebuilt the image without this functionality and ran the container, all tests passed.
    nataliejschultz committed May 17, 2024
    Configuration menu
    Copy the full SHA
    a0f2424 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9fb0e5a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    18a8872 View commit details
    Browse the repository at this point in the history

Commits on May 21, 2024

  1. Update image_build_push.yml

    Removing consolidate differences branch
    nataliejschultz authored May 21, 2024
    Configuration menu
    Copy the full SHA
    53015c7 View commit details
    Browse the repository at this point in the history
  2. Update docker_start_script.sh

    Removing DB_HOST if-else functionality, as it's not necessary for the container.
    nataliejschultz authored May 21, 2024
    Configuration menu
    Copy the full SHA
    41a410c View commit details
    Browse the repository at this point in the history
  3. Setting DB_HOST=db

    Setting  DB_HOST=db as the default for running in a docker container
    nataliejschultz authored May 21, 2024
    Configuration menu
    Copy the full SHA
    7405ff1 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2024

  1. Update docker_start_script.sh

    Removing unnecessary echo
    nataliejschultz authored May 22, 2024
    Configuration menu
    Copy the full SHA
    cd62247 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ebc8188 View commit details
    Browse the repository at this point in the history
  3. Update config.py

    Updating to reflect the changed names of the debug.conf.json files
    nataliejschultz authored May 22, 2024
    Configuration menu
    Copy the full SHA
    41ae79f View commit details
    Browse the repository at this point in the history
  4. Push to rename

    My machine is acting up and not allowing me to rename this file. Going to do it manually in github, but need to make an inconsequential change first.
    nataliejschultz committed May 22, 2024
    Configuration menu
    Copy the full SHA
    290b0fc View commit details
    Browse the repository at this point in the history
  5. Update and rename debug.conf.json.sample to debug.conf.dev.json

    Removing the inconsequential change from the last push and renaming manually. This was my issue: desktop/desktop#13588
    nataliejschultz authored May 22, 2024
    Configuration menu
    Copy the full SHA
    29869cd View commit details
    Browse the repository at this point in the history
  6. common.py fix?

    Thought I would quickly change the name of debug.conf.json.sample to debug.conf.dev.json; this was not inconsequential. Seeing if this fixes it.
    nataliejschultz committed May 22, 2024
    Configuration menu
    Copy the full SHA
    38209ef View commit details
    Browse the repository at this point in the history

Commits on May 23, 2024

  1. Removing redundant DB_HOST setting

    DB_HOST is hardcoded in the compose file that runs this script anyway.
    nataliejschultz authored May 23, 2024
    Configuration menu
    Copy the full SHA
    da485c2 View commit details
    Browse the repository at this point in the history

Commits on May 24, 2024

  1. reverting dockerfile + start script changes

    reverting to DB_HOST='' since setting it to db probably isnt the best idea.
    
    Also removing the DB_HOST fallback in start_script.sh since it'll be caught in config.py
    nataliejschultz committed May 24, 2024
    Configuration menu
    Copy the full SHA
    e6b388b View commit details
    Browse the repository at this point in the history

Commits on May 26, 2024

  1. Testing workflows with compose

    Had to revert some changes but need to test the functionality of docker compose
    nataliejschultz committed May 26, 2024
    Configuration menu
    Copy the full SHA
    bb03c42 View commit details
    Browse the repository at this point in the history
  2. Triggering workflows.

    nataliejschultz committed May 26, 2024
    Configuration menu
    Copy the full SHA
    cf50d17 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6a21f5d View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2024

  1. Not showing changes to branches for some reason in image_build_push.yml

    I removed the consolidate differences branch a long time ago, but this change is not reflected in the code review space for some reason. Trying to force it to display the change.
    nataliejschultz authored Jun 10, 2024
    Configuration menu
    Copy the full SHA
    b961417 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2024

  1. Adding comment to see if it resolves github display error

    GitHub isn't displaying the changes I've made to this file, namely removing the consolidate-differences branch. I'm not sure why it's not displaying this, since when I go to edit the file in github, it looks correct. So, I'm adding a comment to see if it updates the file and makes it display correctly.
    nataliejschultz committed Jun 17, 2024
    Configuration menu
    Copy the full SHA
    a245e7d View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2024

  1. 🩹 Don't cat the db.conf file

    Since it won't exist
    e-mission#961 (comment)
    shankari committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    2067055 View commit details
    Browse the repository at this point in the history
  2. 🩹 Use the correct filename in the gitignore

    To be consistent with
    e-mission@29869cd
    shankari committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    3000758 View commit details
    Browse the repository at this point in the history
  3. 🩹 Set the default value for the DB_HOST as well

    Since we now don't set it in the start script, we should do so in the
    `Dockerfile`, consistent with the `WEB_SERVER_HOST` set in
    912bd34
    
    It is interesting that this was set earlier but then reverted in
    e6b388b
    
    As long as we can override it, I think we should be fine.
    shankari committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    6a8a13f View commit details
    Browse the repository at this point in the history
  4. 🩹 Unify the supported user inputs across the debug and prod configs

    Before this change
    
    ```
    <     "userinput.keylist": ["manual/mode_confirm", "manual/purpose_confirm", "manual/trip_user_input", "manual/place_user_input"]
    ---
    >     "userinput.keylist": ["manual/mode_confirm", "manual/purpose_confirm", "manual/replaced_mode", "manual/trip_user_input"]
    ```
    
    After this change, no diffs in the `userinput.keylist`. Only changes are to the
    assertions being enabled
    
    ```
    $ diff conf/analysis/debug.conf.dev.json conf/analysis/debug.conf.prod.json
    3,4c3,4
    <     "intake.cleaning.clean_and_resample.speedDistanceAssertions": true,
    <     "intake.cleaning.clean_and_resample.sectionValidityAssertions": true,
    ---
    >     "intake.cleaning.clean_and_resample.speedDistanceAssertions": false,
    >     "intake.cleaning.clean_and_resample.sectionValidityAssertions": false,
    ```
    shankari committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    fc183cb View commit details
    Browse the repository at this point in the history
  5. 🩹 Remove the cat of db.conf from the integration tests as well

    Similar to 2067055 but in a different file
    shankari committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    51e16de View commit details
    Browse the repository at this point in the history
  6. 🩹 Cleanup environment variables in the basic start script

    - Remove cat
    - Don't set WEB_HOST since it is set in the Dockerfile
    
    Consistent with:
    2067055 and
    51e16de
    shankari committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    7ab37b6 View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2024

  1. ♻️ Move the config to a different file name that makes more sense

    So that we can consolidate all the backwards compat code in one place.
    
    if there is a config file and the environment variable is set, we need to
    decide which one wins. We will pull out the code into a common class to ensure
    DRY. Once the backwards compat has been removed, this can be merged into
    the individual config files
    shankari committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    727c00c View commit details
    Browse the repository at this point in the history
  2. ♻️ Refactor the backwards config file to be reusable

    1. This will avoid having multiple, almost identical, copies of the same file
    2. It will ensure that we read the code primarily in "the new way" from a dict
    3. it should make removing the backwards compat layer easier in the future
    since we are reading from a dict with a default anyway
    
    Testing done:
    
    ```
    $ ./e-mission-py.bash emission/tests/storageTests/TestTimeSeries.py
    ----------------------------------------------------------------------
    Ran 8 tests in 18.819s
    
    OK
    ```
    shankari committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    7f1be92 View commit details
    Browse the repository at this point in the history
  3. 🔊 log the full backtrace if the config file is formatted incorrectly

    This allows us to troubleshoot the config files and fix them instead of only
    falling back to the defaults.
    shankari committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    7177e71 View commit details
    Browse the repository at this point in the history
  4. ♻️ Move the api configuration into the backwards compat as well

    Consistent with
    e-mission#961 (comment)
    and 7f1be92 (which was the original example
    for the database)
    shankari committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    168ef10 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2024

  1. ♻️ Move the api configuration into the backwards compat as well

    Consistent with
    e-mission#961 (comment)
    and 7f1be92 (which was the original example
    for the database)
    
    Testing done:
    
    1. Started the webapp with no overridden config
    
    ```
    Config file not found, returning a copy of the environment variables instead...
    Finished configuring logging for <RootLogger root (WARNING)>
    Using auth method skip
    Replaced json_dumps in plugin with the one from bson
    Changing bt.json_loads from <function <lambda> at 0x10b2b08b0> to <function <lambda> at 0x10bd6a940>
    Running with HTTPS turned OFF - use a reverse proxy on production
    Bottle v0.13-dev server starting up (using CherootServer())...
    Listening on http://0.0.0.0:8080/
    Hit Ctrl-C to quit.
    ```
    
    2. Started the webapp with an invalid config override
    
    ```
    ERROR:root:Expecting ',' delimiter: line 12 column 5 (char 464)
    Traceback (most recent call last):
      File "/Users/kshankar/Desktop/data/e-mission/gis_branch_tests/emission/core/backwards_compat_config.py", line 28, in get_config
        loaded_val = pd.json_normalize(json.load(config_file)).iloc[0]
    ...
    json.decoder.JSONDecodeError: Expecting ',' delimiter: line 12 column 5 (char 464)
    Config file not found, returning a copy of the environment variables instead...
    ```
    
    3. Started the webapp with a valid config override
    
    ```
    Finished configuring logging for <RootLogger root (WARNING)>
    Using auth method token_list
    Replaced json_dumps in plugin with the one from bson
    Changing bt.json_loads from <function <lambda> at 0x10fd2a8b0> to <function <lambda> at 0x1107e5940>
    Running with HTTPS turned OFF - use a reverse proxy on production
    Bottle v0.13-dev server starting up (using CherootServer())...
    Listening on http://0.0.0.0:8080/
    Hit Ctrl-C to quit.
    ```
    shankari committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    3dea305 View commit details
    Browse the repository at this point in the history
  2. ♻️ Move the push configuration into the backwards compat as well

    Consistent with
    e-mission#961 (comment)
    and
    - 3dea305 (example for the api)
    - 7f1be92 (original example for the database)
    
    Testing done:
    
    ```
    $ ./e-mission-py.bash emission/tests/netTests/TestPush.py
    ----------------------------------------------------------------------
    Ran 5 tests in 0.276s
    
    OK
    ```
    shankari committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    a0f0c6a View commit details
    Browse the repository at this point in the history
  3. 🔊 Indicate that we are using the default production config

    if no override is found
    shankari committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    10624a6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0fe9476 View commit details
    Browse the repository at this point in the history
  5. ♻️ Pull out the code to reset the environment variable overrides to a…

    … common file
    
    This is consistent with
    - a0f0c6a (push config)
    - 3dea305 (api config)
    
    but ensures that we follow DRY
    shankari committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    11d2a89 View commit details
    Browse the repository at this point in the history
  6. ✅ Fix the expected text while checking for tokens

    In 7f1be92, we changed the DB configuration
    to be based on environment variables. This changed the output text when
    importing the module and launching the script. This change fixes the test
    token tests that compare the output text with a baseline to reflect the new
    expected text.
    shankari committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    4cc4c58 View commit details
    Browse the repository at this point in the history
  7. 🔥 Remove the copied over config file

    Since we now use the standard backwards compat module (a0f0c6a)
    shankari committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    357d4b8 View commit details
    Browse the repository at this point in the history
  8. ♻️ Access the environment variables from the config using .get

    So that we can get a full list of the environment variable by grepping
    properly
    
    ```
    $ grep -r 'config.get("[A-Z]' emission/
    emission//net/ext_service/push/notify_interface_impl/firebase.py:        self.server_auth_token = push_config.get("PUSH_SERVER_AUTH_TOKEN")
    emission//net/ext_service/push/notify_interface_impl/firebase.py:            self.app_package_name = push_config.get("PUSH_APP_PACKAGE_NAME")
    emission//net/ext_service/push/notify_interface_impl/firebase.py:        self.is_fcm_format = push_config.get("PUSH_IOS_TOKEN_FORMAT") == "fcm"
    emission//net/ext_service/push/notify_interface.py:        return NotifyInterfaceFactory.getNotifyInterface(push_config.get("PUSH_PROVIDER"))
    emission//net/api/cfc_webapp.py:server_port = config.get("WEBSERVER_PORT", 8080)
    emission//net/api/cfc_webapp.py:socket_timeout = config.get("WEBSERVER_TIMEOUT", 3600)
    emission//net/api/cfc_webapp.py:auth_method = config.get("WEBSERVER_AUTH", "skip")
    emission//net/api/cfc_webapp.py:aggregate_call_auth = config.get("WEBSERVER_AGGREGATE_CALL_AUTH", "no_auth")
    emission//net/api/cfc_webapp.py:not_found_redirect = config.get("WEBSERVER_NOT_FOUND_REDIRECT", "https://nrel.gov/openpath")
    emission//core/get_database.py:url = config.get("DB_HOST", "localhost")
    emission//core/get_database.py:result_limit = config.get("DB_RESULT_LIMIT", 250000)
    ```
    shankari committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    b6f59b0 View commit details
    Browse the repository at this point in the history
  9. ✅ Remove environment variables that are likely to be different across…

    … runs
    
    The tests failed because we now print all environment variables, and the
    `hostname` changes between runs. So comparing the output with the known good
    output always fails. We strip out variables that are likely to change over
    time (hostname, conda version...) to make this test more robust.
    
    1. We technically only need the hostname right now, but will add the conda
    version as well so that we don't get spurious failures when the versions
    change
    2. this was not an issue earlier because we read the values from the config
    file. We now read environment variables, but that brings in variables that we
    did not set. So this is a new issue that we need to resolve by stripping them
    out for the baseline comparison.
    
    ```
    $ ./e-mission-py.bash emission/tests/storageTests/TestTokenQueries.py
    ----------------------------------------------------------------------
    Ran 21 tests in 23.591s
    
    OK
    ```
    shankari committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    ec38835 View commit details
    Browse the repository at this point in the history
  10. ✅ Delete all irrelevant config variables

    Consistent with
    e-mission#961 (comment)
    
    Testing done:
    
    ```
    ----------------------------------------------------------------------
    Ran 21 tests in 23.106s
    
    OK
    ```
    shankari committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    1a0d451 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    2fe0816 View commit details
    Browse the repository at this point in the history