Skip to content

Support Tahoe 2.0 site configuration client#63

Merged
OmarIthawi merged 2 commits intomasterfrom
tahoe_support
Sep 22, 2022
Merged

Support Tahoe 2.0 site configuration client#63
OmarIthawi merged 2 commits intomasterfrom
tahoe_support

Conversation

@OmarIthawi
Copy link
Copy Markdown
Contributor

@OmarIthawi OmarIthawi commented Sep 16, 2022

Fix RED-3385. Read Tahoe 2 site from secret on Tahoe 2.0 sites and from site_values on Tahoe 1.0 sites.

Breaking change

Tahoe Hawthorn is no longer supported in v4.0.0 due to the lack of Site Configuration Client. It will act as if it's installed on a Vanilla Hawthorn.

TODO

  • Test on devstack with site configuration on a Tahoe 2.0 site
    • with site-specific value
    • with ENV_TOKENS value
  • Test on devstack with site configuration on a Tahoe 1.0 site
    • with site-specific value
    • with ENV_TOKENS value

@OmarIthawi OmarIthawi force-pushed the tahoe_sites_support branch 7 times, most recently from 4a80014 to bc1ce1c Compare September 16, 2022 12:16
Base automatically changed from tahoe_sites_support to master September 16, 2022 12:45
@OmarIthawi OmarIthawi force-pushed the tahoe_support branch 3 times, most recently from 7030a72 to 8532952 Compare September 19, 2022 12:27
@OmarIthawi OmarIthawi marked this pull request as ready for review September 19, 2022 13:25
@OmarIthawi OmarIthawi changed the title support tahoe2 site configuration client Support Tahoe 2.0 site configuration client Sep 19, 2022
Comment thread launchcontainer/test_settings.py Outdated
Comment thread launchcontainer/tests.py Outdated
briandant
briandant previously approved these changes Sep 19, 2022
 - fix author_view when wharf_url is missing
 - support rendering templates in tests
 - new author_view for studio
 - refactored tests
 - Tahoe Hawthorn is no longer supported in v4.0.0 due to the lack of Site Configuration Client. It will act as if it's installed on a Vanilla Hawthorn.
 - Install `tahoe-sites` and `site-configuration-client` to simulate Tahoe environment.
 - Add support for Tahoe 2.0 site by reading `LAUNCHCONTAINER_WHARF_URL` from Site Config Service `secret`s. Tahoe 1.0 sites will still use `site_values` as usual
 - Breaking change: Drop support for pre-Juniper Tahoe installations. The last version to support Hawthorn is `3.0.0`
need to complicate the XBlock with caching calls.

 - Simplify reading the Wharf URL
   * Read from `ENV_TOKENS` for regular Open edX installation (non-Tahoe)
   * Read from [Site Configuration Client](https://github.com/appsembler/site-configuration-client/) for Juniper+ installations

 - Refactored unit tests
 - Refactor testing environments in `tox.ini` to test for `tahoe` and non `tahoe` environments removing `tox-gh-actions`.
 - Remove complex and low-value caching for `wharf_url`
Copy link
Copy Markdown
Contributor

@briandant briandant left a comment

Choose a reason for hiding this comment

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

many thanks, @OmarIthawi!

Comment thread CHANGELOG.md
- Install `tahoe-sites` and `site-configuration-client` to simulate Tahoe environment.
- Add support for Tahoe 2.0 site by reading `LAUNCHCONTAINER_WHARF_URL` from Site Config Service `secret`s. Tahoe 1.0 sites will still use `site_values` as usual
- Breaking change: Drop support for pre-Juniper Tahoe installations. The last version to support Hawthorn is `3.0.0`
need to complicate the XBlock with caching calls.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
need to complicate the XBlock with caching calls.
- Do not complicate the XBlock with caching calls.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

actually I think you can delete this line—it's duplicated below

Comment thread CHANGELOG.md

- Install `tahoe-sites` and `site-configuration-client` to simulate Tahoe environment.
- Add support for Tahoe 2.0 site by reading `LAUNCHCONTAINER_WHARF_URL` from Site Config Service `secret`s. Tahoe 1.0 sites will still use `site_values` as usual
- Breaking change: Drop support for pre-Juniper Tahoe installations. The last version to support Hawthorn is `3.0.0`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Breaking change: Drop support for pre-Juniper Tahoe installations. The last version to support Hawthorn is `3.0.0`
- Breaking change: Drop support for pre-Juniper Tahoe installations. The last version to support Hawthorn is `3.0.0`


return url
def get_wharf_delete_url(self, required=True):
wharf_url = self.get_wharf_url(required=required)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure I totally understand why we check for a wharf url and then return None. I think it's because we want this method (get_wharf_delete_url) to also make it clear that no URL is available. I'm also not sure why we'd return a delete URL if required=False but there is no wharf_url. I just need a docstring or comment here, I think.

<div id="launcher_notification" class="hide"></div>
{% if enable_container_resetting %}<button type="button" class="ui-priority-primary" id="launcher_reset">Reset lab</button>{% endif %}

{% else %}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great addition here 👍

{% else %}
{# This message is intended to appear Studio for course authors. #}
<p><strong>Error: Unable to connect to the Appsembler Virtual Labs API endpoint.</strong></p>
<p>Please configure your Appsembler Virtual Labs API endpoint before using this XBlock.</p>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
<p>Please configure your Appsembler Virtual Labs API endpoint before using this XBlock.</p>
<p>Please contact <a href="mailto:support@appsembler.com" target="_blank">Appsembler Support</a> so we can configure your Appsembler Virtual Labs API endpoint.</p>

I could be wrong, but I don't think that the customer can configure this on his own, right? My suggested phrasing above captures that. If he can, I think we should talk with Matthew about writing some customer docs on that (or maybe the docs already exist).

@OmarIthawi OmarIthawi merged commit 43177a3 into master Sep 22, 2022
@OmarIthawi OmarIthawi deleted the tahoe_support branch September 22, 2022 17:26
@OmarIthawi
Copy link
Copy Markdown
Contributor Author

Thanks Brian!! I'll follow up on all additions in another PR to avoid GitHub invalidating your review.

OmarIthawi added a commit that referenced this pull request Sep 22, 2022
OmarIthawi added a commit that referenced this pull request Sep 23, 2022
clean up and review comments for PR #63
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