-
Notifications
You must be signed in to change notification settings - Fork 95
Standardize Environment Directory Structure #145 #160
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
Conversation
|
Hi @rycerzes! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
@zkwentz @burtenshaw @init27 @jspisak this is the PR for #145 |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Amazing @rycerzes I took a cursory look and impressive to see One immediate thing that stands out, can you move your build-docker script to And thank you for jumping on this so fast, you're helping us get out of the woods :) |
Added 👍 |
|
Really nice draft PR @rycerzes. Thanks for the contribution. I haven't gone team yet I'm just exploring at a high level. My first question is why do we need I understand that we need to do a one time conversion of the legacy envs in this repo and in the wild, but I'm not sure if we need to maintain that code within the cli. We could just keep the functionality within |
It's a temporary command, which I will remove before the PR is merged. I had previously planned to migrate the existing envs in a different PR but it would be wise to update the envs in this PR itself |
|
Okay played around with things a bit. Love the changes you have made to standard template. One thing I think we haven't made clear enough, and we should make clear once this PR is merged is this: The new approach is for this repository to be the specification and CLI repo with some canonical examples of interesting examples (criteria for a good example environment is to demonstrate new specification or openenv core functionality). Going forward, all other environments, will be assumed to have been started with All CLI commands will be assumed to be running from the root of an So for your newly added commands can you remove the
etc. Additional feedback:
I'll add inline comments now that are in pursuit of this direction. |
|
One last thing, though you are killing off @rycerzes since you're closest to the new standard, can you write up Things to cover that come to mind:
|
|
@zkwentz Thanks for the detailed review! I understand the new CLI-first approach and will make all the requested changes Questions:
I'll have these changes ready in some time :) |
- update push and validate commands
I see what you're saying, it's a bit wonky because we do a custom build for Hugging Face... it will be like that for some time as well. It's making sense to me now why you included a registry push on build instead of push itself. Would it be weird to have three optional arguments:
Resulting in the following options:
No preferences :) Thank you! |
burtenshaw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good work so far @rycerzes. Since we're dependent on this PR, I think we should limit it down and return to some features in subsequent PRs.
|
+1 @burtenshaw, we need this PR to land asap. Standardize template, convert, update other PRs. @rycerzes if you can descope this to land it more quickly please do. |
|
@zkwentz @burtenshaw Thanks for the feedback! I completely understand the need to land this quickly. I'll descope this PR to focus on the core standardization. @burtenshaw - Re: port exposure - yes, I'll add port as a CLI argument to the app.py entrypoint. @burtenshaw - Re: dependencies - the downstream images will inherit the base dependencies and add their own in their respective pyproject.toml files. What's staying in this PR:
What's being removed:
For the push command flags, I'll implement the structure you proposed: --interface, --no-interface, and --registry options. I'll have these changes pushed shortly. |
|
Thanks so much @rycerzes sorry to put pressure on like this, but we've got a backlog and two imminent hackathons to get ahead of :) |
|
All good @zkwentz! I’ve already pushed the updates for review so we can move this forward quickly :) |
|
Thanks @rycerzes . This is Pro work. I'm reviewing now. |
zkwentz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rycerzes thank you for quickly jumping in and getting this updated.
It looks good to me, with one note: this does not convert the other environments and it may in fact break them given the removal of some downstream dependencies in the simplified base image (as noted by @burtenshaw).
I think it's fine to land this without completing that effort and to let those that authored the environments come in and follow your wonderful conversion guideline (and script) as a follow up exercise.
Yes, only the |
|
Thank you @rycerzes 🙏 @burtenshaw good to ship it? |
burtenshaw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Amazing work @rycerzes and thanks again.
This PR standardizes the OpenEnv environment structure to support standalone development, multi-mode deployment, and better dependency management using
pyproject.tomlanduv.Key Changes
Standardized Environment Structure
requirements.txttopyproject.tomlfor dependency managementopenenv.yamlmanifest file for environment metadataoutputs/directory structure (logs, evals) - gitignoredNew CLI Commands
openenv build- Build Docker images with automatic context detection (standalone vs in-repo)openenv validate- Validate environment configuration for multi-mode deploymentopenenv serve- Run environments locally without Docker (placeholder implementation)Enhanced Existing Commands
openenv init- Now generatespyproject.tomlinstead ofrequirements.txt, includesopenenv.yamlmanifestopenenv push- Updated to work with new structure, improved HuggingFace deployment flowDependency Management Overhaul
pyproject.tomlnow contains only minimal shared dependencies (fastapi, pydantic, uvicorn, CLI tools)pyproject.tomlfilesuv.lockfiles for reproducible builds0.1.0→0.1.1tomli>=2.3.0,tomli-w>=1.2.0for TOML manipulationUpdated Templates
pyproject.tomlwith proper structureuvintegration and multi-stage buildspyproject.tomlduring buildCore Infrastructure
_validation.pymodule for environment validation logic_cli_utils.pywith additional utility functionsuvsupportsrc/core/pyproject.tomlDocumentation and Migration Tools
scripts/CONVERT.md- comprehensive guide for converting existing environmentsscripts/convert_env.sh- automated conversion script for environmentsREADME.mdwith new dependency management workflow and development patternsEcho Environment Updated
echo_envto new standard as reference implementationpyproject.toml,openenv.yaml, anduv.lock