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

Make stores and schedulers lists of named specs #1496

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aaronmondal
Copy link
Member

@aaronmondal aaronmondal commented Nov 24, 2024

To migrate, change your config like this (similar for schedulers):

// Old:
"stores": {
  "SOMESTORE": {
    "memory": {}
  }
}

// New:
"stores": [
  {
    "name": "SOMESTORE",
    "memory": {}
  }
]

Closes #834


This change is Reviewable

Copy link
Member Author

@aaronmondal aaronmondal left a comment

Choose a reason for hiding this comment

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

+@allada

Reviewable status: 0 of 1 LGTMs obtained, and 0 of 14 files reviewed, and pending CI: Bazel Dev / macos-13, Bazel Dev / macos-14, Bazel Dev / ubuntu-24.04, Cargo Dev / macos-13, Cargo Dev / ubuntu-22.04, Coverage, Installation / macos-13, Installation / macos-14, Installation / ubuntu-22.04, Local / ubuntu-22.04, NativeLink.com Cloud / Remote Cache / macos-14, NativeLink.com Cloud / Remote Cache / ubuntu-24.04, Publish image, Publish nativelink-worker-init, Publish nativelink-worker-lre-cc, Remote / large-ubuntu-22.04, Web Platform Deployment / macos-14, Web Platform Deployment / ubuntu-24.04, asan / ubuntu-22.04, docker-compose-compiles-nativelink (22.04), integration-tests (22.04), macos-13, pre-commit-checks, ubuntu-20.04 / stable, ubuntu-22.04, ubuntu-22.04 / stable, windows-2022 / stable (waiting on @allada)

@MarcusSorealheis
Copy link
Collaborator

This is amazing but will obviously need a lot of testing.

We also need to document a migration path.

Copy link
Member

@allada allada left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 LGTMs obtained, and 0 of 14 files reviewed, and pending CI: Remote / large-ubuntu-22.04, and 1 discussions need to be resolved


nativelink-config/src/cas_server.rs line 728 at r1 (raw file):

    /// List of stores available to use in this config.
    /// The keys can be used in other configs when needing to reference a store.
    pub stores: Vec<StoreConfig>,

Lets make this backwards compatible by making it a custom type that is a wrapper around Vec<StoreConfig>, but has a custom decoder that will be able to translate either Vec<StoreConfig> or Map<StoreRefName, StoreSpec> and throw a runtime deprecation warning if the user needs to migrate.

Copy link
Member Author

@aaronmondal aaronmondal left a comment

Choose a reason for hiding this comment

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

We also need to document a migration path.

Done. Using the old config scheme now prints a big warning message with an example of how to migrate.

Reviewable status: 0 of 1 LGTMs obtained, and 0 of 17 files reviewed, and pending CI: Coverage, Local / ubuntu-22.04, Publish image, Publish nativelink-worker-init, Web Platform Deployment / macos-14, Web Platform Deployment / ubuntu-24.04, docker-compose-compiles-nativelink (22.04), integration-tests (22.04), pre-commit-checks, ubuntu-20.04 / stable, ubuntu-22.04 / stable, vale, and 1 discussions need to be resolved (waiting on @allada)


nativelink-config/src/cas_server.rs line 728 at r1 (raw file):

Previously, allada (Nathan (Blaise) Bruer) wrote…

Lets make this backwards compatible by making it a custom type that is a wrapper around Vec<StoreConfig>, but has a custom decoder that will be able to translate either Vec<StoreConfig> or Map<StoreRefName, StoreSpec> and throw a runtime deprecation warning if the user needs to migrate.

Done.

@aaronmondal aaronmondal changed the title [Breaking] Make stores and schedulers lists of named specs Make stores and schedulers lists of named specs Nov 25, 2024
To migrate, change your config like this (similar for schedulers):

```
// Old:
"stores": {
  "SOMESTORE": {
    "memory": {}
  }
}

// New:
"stores": [
  {
    "name": "SOMESTORE",
    "memory": {}
  }
]
```

For now this is not a breaking change, but a backwards compatible one.
The backwards-compatibility code will be removed after the next release
in a breaking change.

Closes TraceMachina#834
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.

[Discussion] How to Improve the Readability and Composability of the NativeLink Config JSON part 1
3 participants