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

chore: improve nx config support and caching #231

Merged
merged 3 commits into from Jan 16, 2023

Conversation

JeremyJonas
Copy link
Contributor

@JeremyJonas JeremyJonas commented Dec 2, 2022

Improve NX project and target configurations

  • enable PDKProject direct nx project config
  • move default nx build target to workspace
  • remove legacy nx override logic
  • separate out aws-arch generate task and enable caching

Improve aws-arch generator caching

  • Replace "cache dir" with "hash based" temp dir to ensure unique empty dir while somewhat minimizing requests during dev
  • Add static/** to generate input caching

@nx-cloud
Copy link

nx-cloud bot commented Dec 2, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 2611211. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@JeremyJonas JeremyJonas changed the title Fix/aws arch caching chore(aws-arch): improve generator caching Dec 4, 2022
@JeremyJonas JeremyJonas changed the title chore(aws-arch): improve generator caching chore: improve nx config support and caching Dec 4, 2022
@JeremyJonas JeremyJonas force-pushed the fix/aws-arch-caching branch 2 times, most recently from 8383aa5 to 150fc59 Compare December 5, 2022 05:29
@JeremyJonas JeremyJonas marked this pull request as ready for review December 5, 2022 05:33
Copy link
Contributor

@agdimech agdimech left a comment

Choose a reason for hiding this comment

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

Overall it looks good and is much cleaner. Just had a few comments.

packages/nx-monorepo/src/nx-monorepo.ts Outdated Show resolved Hide resolved
packages/nx-monorepo/src/nx-types.ts Show resolved Hide resolved
@agdimech agdimech marked this pull request as draft December 7, 2022 01:26
@github-actions
Copy link

This pull request is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon. If you wish to exclude this issue from being marked as stale, add the "backlog" label.

@github-actions github-actions bot added the stale label Dec 26, 2022
@github-actions
Copy link

github-actions bot commented Jan 2, 2023

Closing this pull request as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen. If you wish to exclude this issue from being marked as stale, add the "backlog" label.

- enable PDKProject direct nx project config
- move default nx build target to workspace
- remove legacy nx override logic
- separate out aws-arch generate task and enable caching

BREAKING CHANGE: modified nx-monorepo config settings for Nx
1. `WorkspaceConfig.nxConfig` type `NxConfig => Nx.WorkspaceConfig`
2. `overrideProjectTargets` removed in favor of `PDKProject.nx`
config to manage Nx project

See [PR 231](aws#231)
@JeremyJonas
Copy link
Contributor Author

JeremyJonas commented Jan 16, 2023

@agdimech After digging a bit deeper here, the real issue is the aws-arch generate script is simply not deterministic due to not being able to pin pricing manifest content that is fetch from the url. All the other sources are hashed urls, so deterministic between builds.

The only way I could make this deterministic is to commit the pricing-manifest.json file to the source code.

I also added a github workflow to run weekly to auto fetch the pricing and run build (which also updates the snapshots) - currently it requires manual approval since I want to see the snapshots since there is lots of auto mapping atm.

Hopefully this works well enough.

Commit for this new code here: 2611211

To support deterministic caching of aws-arch genoration of
aws pricing, we need to store the manifest locally since.

Creating github workflow to support weekly updates along with
snapshot updates and build verification - currently requires
manually approval.
@agdimech agdimech merged commit ecdc5a7 into aws:mainline Jan 16, 2023
agdimech pushed a commit that referenced this pull request Jan 16, 2023
- enable PDKProject direct nx project config
- move default nx build target to workspace
- remove legacy nx override logic
- separate out aws-arch generate task and enable caching

BREAKING CHANGE: modified nx-monorepo config settings for Nx
1. `WorkspaceConfig.nxConfig` type `NxConfig => Nx.WorkspaceConfig`
2. `overrideProjectTargets` removed in favor of `PDKProject.nx`
config to manage Nx project

See [PR 231](#231)
@JeremyJonas JeremyJonas deleted the fix/aws-arch-caching branch March 28, 2023 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants