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

Bszabo/tnl 10899 #228

Merged
merged 19 commits into from
Sep 11, 2023
Merged

Bszabo/tnl 10899 #228

merged 19 commits into from
Sep 11, 2023

Conversation

bszabo
Copy link
Contributor

@bszabo bszabo commented Sep 5, 2023

This PR supersedes #218. That PR led us to understand that we needed a fair bit of discovery work pertaining to how the scripts in this repo are used. (See also cancelled PSRE-2583). The work in that PR is incorporated here, and this PR contains answers from the ensuing discovery work.

This PR contains the results of experimentation with the AWS API Gateway on the edx-playground-admin account per TNL-10899. It adds a new documentation file, docs/configuration_objects.md, with background information about API Gateway objects on AWS, and how they're used, and how they're accessed on the AWS console.

Then, the PR adds scripts for the SRE team to use to add the Studio content API to the suite of APIs offered on our AWS API gateway. Capturing invocation information had not been part of the repo, but given that the repo's sole use is to assist with edX's management of its API Gateway depoloyments, it seems reasonable to include an audit trail within the repo. Each once-and-done script has a comment line at its head, intended to indicate whether the script has ever been run, and, if so, the date on which it was run.

Finally, the PR adds instructions for the SRE team to follow when updating the stage and prod environment API gateway settings to include the Studio content API. (See SRE_request_studio_content_api_addition.md). It also includes rollback instructions, should something fail.

Testing this PR

Step 1 - read the background info in this PR
Step 2 - log into the AWS console using the edx-playground-admin role
Step 3- Use the CloudShell interface in the AWS console to run scripts on the API gateway's EC2 instance
Step 4- Run the scripts provided in the PR for the stage and prod environments on the playground's API Gateway

Notes:

  • there is just one environment in the playground API Gateway
  • the custom domain name is gwtst.edx.us.org. You'll need to replace the hard-coded domain name in the deploy_repo_to_prod_env_api_gw.sh script if you choose to work with the prod script variants on the playground. (Alternatively, work with the stage scripts and make the change there).

Bernard Szabo and others added 9 commits June 29, 2023 15:48
Three endpoints for file asset uploads, video asset uploads, and XBlock CRUD operations
Track script invocations as an audit trail for API gateway configuration changes

SRE instructions for deploying changes in this PR to stage and prod environments
base domain is not parameterized, but target
API Gateway stage is
@bszabo
Copy link
Contributor Author

bszabo commented Sep 5, 2023

I see the failed commit test and will attend to it late today or tomorrow

--registrar-host stage-edx-registrar.edx.org \
--catalog-host catalog.stage.edx.org \
--enterprise-catalog-host enterprise-catalog.stage.edx.org \
--studio-host courses.stage.edx.org
Copy link
Member

Choose a reason for hiding this comment

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

Do you think it would be better if these variable were read from configuration objects / files that can be updated via PR in the repo, instead of always updating the values in these deploy commands directly?

Copy link
Member

Choose a reason for hiding this comment

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

Not certain if that was a good suggestion by me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm uncertain what sort of reception this proposal will get from the SRE team. I'll leave anything more than trivial changes for the future, when it's become clear this repo will endure som

Bernard Szabo and others added 10 commits September 8, 2023 08:35
Commented out legacy Swagger code as part of
binary search to determine which part of YAML
file is generating CI test errors
Looking to get past build errors
swagger codegen 2.4.32
Trying to get past build errors
This reverts commit bf679ee.
@bszabo
Copy link
Contributor Author

bszabo commented Sep 11, 2023

The multiple commits following Jesper's approval are, largely, a trip to nowhere. At the time of the approval, Python CI tests were still failing. The intervening commits were for diagnostic purposes, to locate the source of the problem. It proved to be version incompatibilities with swagger-codegen-cli. These proved pesky to fix, and I opted for the simplest solution, which was to revert the api.yaml file to a "swagger 2.0" designation, what it had been all along. Apparently moving to an "Openapi 3.0" designation requires a newer version of swagger-codegen-cli, and getting this to work just isn't worth the trouble for now.

@bszabo bszabo merged commit c9a639c into master Sep 11, 2023
3 checks passed
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.

2 participants