o3de / sig-network

9 stars 8 forks source link

Proposed RFC Feature: Remove Amazon gems from O3DE #64

Closed allisaurus closed 1 year ago

allisaurus commented 2 years ago

Summary:

Currently there are 6 Amazon-specific gems within the main o3de/o3de repo: AWSCore, AWSClientAuth, AWSMetrics, AWSGameLift, the Twitch gem, and HttpRequestor (which is essentially a wrapper around AWSNativeSDK types and methods for making REST calls). These gems are unique in that they are optional and vendor-specific, yet live within the main engine source code. This RFC proposes extracting these gems to their own, Amazon-owned GitHub repositories and removing (over time) the versions of these gems that live within the engine source. This will improve the vendor neutrality of the engine itself, while allowing for development of these gems to continue in a leaner, more decoupled way from that of the entire engine.

What is the relevance of this feature?

This work will change where 6 gems within o3de/o3de are housed, how they’re pulled into O3DE projects, and (potentially) how they’re advertised to the community. The biggest impact, from a user perspective, will be that once this work is completed, users will need to register the individual Amazon gem repositories with the project manager before being able to see and select them for inclusion in a project (unless other mechanisms are identified - see “open questions”, below). Users of the existing gems would need to migrate to use the external gems in order to continue pulling in the latest fixes & features.

Feature design description:

At a high level, this work would entail making the following changes, in order:

  1. Publish the 6 Amazon gems in public, Amazon-maintained repositories. It’s likely they won’t all be published at the same time, but AWSCore will need to be extracted first so that subsequent external gems can depend on it. These external Amazon gems should be functionally equivalent to the existing “included” gems and also maintained as permissively licensed open source projects.
  2. Communicate to the community that the external versions of the Amazon gems are now available, along with instructions for migration and links to their docs (if docs are moved. See “Open Questions”, below). This communication should include, at a minimum, announcements in the relevant SIGs and on Discord, published notices on the o3de.org docs pages for the effected gems, and comments in the engine source Amazon Gems which indicate they are being deprecated in favor of their external counterparts. It may also include, pending agreement of SIG-Release, release notes in the final (and/or penultimate) versions of engine which include the Amazon gems that they will be removed in a future release.
  3. After a pre-determined amount of time, automated review (AR) tests run on the Amazon gems within the engine will be switched to non-blocking, or removed entirely. New issues cut against the Amazon Gems will be routed to the external repositories (exact mechanisms for this are TBD, will need to established in further conversations with SIG-Network).
  4. After a pre-determined amount of time (at least one release cycle), the Amazon Gems will be red coded from https://github.com/o3de/o3de.
  5. As development of the extracted Amazon gems continues, new versions of the AWSNativeSDK will be stored in, and pulled from, a separate distribution point (vs. the central 3rd party system), since they will not be a dependency of anything in the engine. Versions of the AWSNativeSDK already in use by released versions of the engine (which include old versions of the Amazon gems) will remain in the central system for backward compatibility.

Technical design description:

The new “external” Amazon gems should be functionally equivalent to the existing source versions of the gems, but will need to differ slightly in terms of build setup and AR due to their new locations. Those differences may include:

Adding the external versions of the gems to an O3DE project will be done as it is now for external gems. See the relevant documentation pages:

What are the advantages of the feature?

Advantages for O3DE:

Advantages for Amazon Gem users:

What are the disadvantages of the feature?

Are there any alternatives to this feature?

An alternative would be to leave the Amazon gems in the main o3de/o3de repo and continue to maintain them there. However, this may set a confusing precedent for adding similar optional vendor gems in the main engine source, which over time would encumber maintenance and testing of the core engine. For example: asking SIG-Network maintainers to incur costs on personal AWS accounts, or other commercial platforms, to fix bugs in the main engine repo is not fair or sustainable.

How will users learn this feature?

Advanced notice of the Amazon gems’ removal from the main engine repo and comprehensive migration instructions will be available and circulated at least one release cycle prior to its execution. As mostly enumerated above in “Feature design”, we plan make the community aware of this change by:

Are there any open questions?

lmbr-pip commented 2 years ago

SIG/Network should probably request a new HttpRequestor like Gem as the current one is provided as convenience and only works on some platforms (as well as for the reasons highlighted above).

ValorZard commented 2 years ago

From my brief experience with this engine, and by talking with people about this engine, one of the main factors I see in it not picking up this engine is the idea that this sis till an Amazon product. They often point to code in the base that isn’t open source and is owned by Amazon. If the Amazon gems were removed, and the entire engine codebase was all licensed under Apache 2.0, it would make using this engine much more appealing in my opinion.

lmbr-pip commented 2 years ago

SIG/Network questions:

allisaurus commented 2 years ago

Does Twitch or other gems have other third party libraries to migrate?

The AWSNativeSDK appears to be the only 3rd party library in use by the Twitch, HttpRequestor, AWSClientAuth, and AWSMetrics gems.

The AWSGameLift gem further uses the AWSGameLiftServerSDK, which will need to be migrated as well (since it's the only gem that uses it).

AWSCore uses a number of other 3rd party libraries, but they're all in use by other gems too (Qt::Core, pyside2, etc.)

byrcolin commented 2 years ago

The objects we remove can either be their own repos or we can combine them in one repo. To fight sprawl we should combine them into one AWS repo. I have instructions on how to accomplish this without losing history.

Example moving a gem object from the engine to some other repo, in this case a aws o3de repo with history: For the AWS repo we want a structure like this:

root
\
  Gems
  \
    AWSClientAuth
    AWSMetrics
   ...
\
  Projects
   \
    AWSProjectGoesHere
   ...
\
  Templates
  \
   AWSTemplateGoesHere
   ...

We can do them all at one time or just one object at a time. Lets consider doing multiple at a time using Gems\AWSClientAuth and Gems\AWSCore as examples:

We need a clean clone of o3de/o3de. Since we are doing multiple objects at once I would copy this newly cloned repo as many times as objects I had to move.

git clone https://github.com/o3de/o3de.git
copy o3de o3de-awsclientauth 
copy o3de o3de-awscore
... 

We don't need to move Gems\AWSClientAuth or Gems\AWSCore into a different subdir as they are already where we want them to relative to the root in the destination repo. In the Gems\AWSClientAuth , but if it wasn't we would add --to-subdirectory-filter Gems/ or were it should go...

We filter out the rest of the repo:

cd o3de-awsclientauth
git filter-repo --path Gems\AWSClientAuth 
cd ..\o3de-awscore
git filter-repo --path Gems\AWSCore
... 

Now o3de-awsclientauth looks like this:

root
\
  Gems
  \
    AWSClientAuth 

And o3de-awscore looks like this:

root
\
  Gems
  \
    AWSCore 

Now we need a clean aws lumberyard o3de destination repo (I'm not sure we have a name for it yet), and for clarity ill rename it aws-extras git clone https://github.com/<whatever it is>.git aws-extras

I'll add the filtered repos as remotes to our o3de-extras

cd aws-extras
git remote add awsclientauth ../o3de-awsclientauth 
git remote add awscore ../o3de-awscore
...

Update the remote: git remote update

Create a new branch so we can PR this back in git switch -C inital-aws

Merge allowing unrelated histories

git merge --allow-unrelated-histories awsclientauth/main
git merge --allow-unrelated-histories awscore/main
...

Push git push origin inital-aws

You then have to take care of any lfs objects by uploading them.

Remove the remotes:

git remote  remove awsclientauth
git remote  remove awscore
...

Then create your PR. Once accepted you then delete Gems\AWSClientAuth and Gems\AWSCore from the o3de/o3de repo or just remove the references in the engine.json to AWSClientAuth and AWSCore for the time being. Create your PR for its removal and done.

As for AR in aws repos, there will be no o3de AR on any non-o3de repo. O3DE AR only occurs on o3de/o3de and soon o3de/o3de-extras and possibly other o3de repos in the future but not yet. Any non o3de repo AR is the responsibility of the external partner to test.

I do not believe it is necessary to change the name of the gems at all. We can keep them in there and simply remove the references to them from the engine.json and the engine will no longer know about them and we can keep them there for a period of time if we wish, I would remove them so there is less confusion. We can simultaneously add the new AWS repo. If we want to keep the objects for a while, we should investigate if we can put a lock on adding and changes to those folder for a period of time.

We will need to do a pass on all o3de projects and make sure the AWS gem references are removed if they are not needed.

The 3rdparty libs can stay where they are at the moment in the o3de, we can move them to an aws server/account and add that server to the LY_PACKAGE_SERVER_URLS later.

The new aws lumberyard repo entry will be added to the o3de engine.json and so will be discoverable by the program manager/cli. I disagree with the characterization that o3de will lack "out of the box" cloud integration or that discoverability will be reduced. It is our job to make the discovery and downloading of the external gems a first class transparent an simple experience as possible. Since they are canonical objects we can shortcut and automate downloading and registration. Further this will also benefit non Amazon cloud providers o3de partners which will now have an even playing field with aws's offerings.

The docs for aws objects are aws's concern and should not live in o3de at all.

allisaurus commented 2 years ago

@byrcolin thanks for weighing in here and for the run-down of how to retain the commit history post-extraction! I agree it should remain intact before/after this effort.

To fight sprawl we should combine them into one AWS repo.

I'm not sure I agree, or at least I'm inclined to limit the scope of what we group together. It would buy us some testing efficiencies to house AWSCore and the gems that rely on it in the same repo, since they could then share a testing project and AR resources (like how AutomatedTesting works now for o3de/o3de). But it would also mean that development of the individual gems would be coupled and potentially unrelated changes (like a metrics pipeline change) may block others (like a game lift feature). But maybe this won't be a big enough problem to outweigh the benefits, especially if game/simulation projects can still consume the gems individually, w/o cloning and pulling down the whole repo.

As for AR in aws repos, there will be no o3de AR on any non-o3de repo. ...Any non o3de repo AR is the responsibility of the external partner to test.

100% agree, the destination repos should have their own AR and release processes. Removing the gems from O3DF's AR is listed above as step 3 under "Feature design description".

I do not believe it is necessary to change the name of the gems at all. We can keep them in there and simply remove the references to them from the engine.json and the engine will no longer know about them and we can keep them there for a period of time if we wish, I would remove them so there is less confusion.

How does migration from one version of the gem(s) to the other work then? I expect the order of operations would work like this, but maybe I'm wrong:

  1. add external gem to project (can't be done if old gem is here b/c of name collision)
  2. Update project code to reference new gem, rebuild.
  3. Test to ensure stuff still works
  4. remove old included gem

Can step 4 can be done first (or simultaneous with step 1) w/o running into problems? I think maybe it'll depend on the project code, but maybe not if the gems' public APIs are exactly the same.

The new aws lumberyard repo entry will be added to the o3de engine.json and so will be discoverable by the program manager/cli. I disagree with the characterization that o3de will lack "out of the box" cloud integration or that discoverability will be reduced. It is our job to make the discovery and downloading of the external gems a first class transparent an simple experience as possible.

This is the part of the equation I had the least insight into when authoring this. We should definitely leverage whatever discovery mechanisms the community supports once these gems live external to https://github.com/o3de/o3de

lmbr-pip commented 1 year ago

Accepted in SIG-Network meeting July 19th. @lmbr-pip to archive.