diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..242fa6a02584e345b472f643ddc32cb1fda20706 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,18 @@ +.git +.DS_Store +__pycache__ +*.pyc +*.pyo +.pytest_cache +.claude +node_modules +build +research +docs +plans +RESEARCH_NOTES.md +trainer +train.py +sim +viz +planner diff --git a/.gitignore b/.gitignore index aa3cd947100233a030e88417f9ad930429c56b97..6563588a202c10e6718b3cd7e592c885e79a613d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,9 +8,6 @@ # testing /coverage -# production -/build - # misc .DS_Store .env.local @@ -28,3 +25,5 @@ __pycache__/ # Reference repos (not pushed to HF) .reference/ +*.pyc +__pycache__/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..aaf15a9780b45d05060a4b961d6671cc9e3a7296 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM node:20-alpine AS web-builder + +WORKDIR /web +COPY package*.json ./ +RUN npm ci --no-audit --no-fund +COPY public ./public +COPY src ./src +RUN npm run build + +FROM ghcr.io/meta-pytorch/openenv-base:latest + +WORKDIR /app + +# Install Python deps first for better layer caching +COPY requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt \ + && pip install --no-cache-dir "openenv-core[core]>=0.2.1" + +# Copy application source +COPY . /app + +# Overlay the compiled React frontend +COPY --from=web-builder /web/build /app/build + +EXPOSE 8000 + +CMD ["uvicorn", "openenv_server.app:app", "--host", "0.0.0.0", "--port", "8000"] diff --git a/README.md b/README.md index cacdb4ddc76d310ab967af8f4440b6b7d28a3f91..9136cba301c0a82d944368088e90a806aaa41d33 100644 --- a/README.md +++ b/README.md @@ -3,81 +3,35 @@ title: Optigami emoji: 🐠 colorFrom: indigo colorTo: red -sdk: static +sdk: docker pinned: false -app_build_command: npm run build -app_file: build/index.html +app_port: 8000 license: mit -short_description: ':)' +short_description: OpenEnv origami environment and demo --- -# Getting Started with Create React App +# Optigami -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). +OpenEnv-compatible origami RL environment with: +- environment + reward checks in `env/` +- OpenEnv server adapter in `openenv_runtime/` and `openenv_server/` +- Dockerized deployment for Hugging Face Spaces -## Available Scripts +Entry point: `openenv_server.app:app` +Manifest: `openenv.yaml` +Container: `Dockerfile` -In the project directory, you can run: +## Local Run -### `npm start` +```bash +uvicorn openenv_server.app:app --host 0.0.0.0 --port 8000 +``` -Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in your browser. +## Frontend (optional local React demo) -The page will reload when you make changes.\ -You may also see any lint errors in the console. +```bash +npm install +npm start +``` -### `npm test` - -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `npm run build` - -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `npm run eject` - -**Note: this is a one-way operation. Once you `eject`, you can't go back!** - -If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. - -You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). - -### Code Splitting - -This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) - -### Analyzing the Bundle Size - -This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) - -### Making a Progressive Web App - -This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) - -### Advanced Configuration - -This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) - -### Deployment - -This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) - -### `npm run build` fails to minify - -This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) +This serves the dashboard against the FastAPI API. diff --git a/build/asset-manifest.json b/build/asset-manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..a47f7d299c8da94d432e2e5bc225318aaccf86fe --- /dev/null +++ b/build/asset-manifest.json @@ -0,0 +1,13 @@ +{ + "files": { + "main.css": "/static/css/main.edb517bf.css", + "main.js": "/static/js/main.7e6cf91b.js", + "index.html": "/index.html", + "main.edb517bf.css.map": "/static/css/main.edb517bf.css.map", + "main.7e6cf91b.js.map": "/static/js/main.7e6cf91b.js.map" + }, + "entrypoints": [ + "static/css/main.edb517bf.css", + "static/js/main.7e6cf91b.js" + ] +} \ No newline at end of file diff --git a/build/favicon.ico b/build/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..a11777cc471a4344702741ab1c8a588998b1311a Binary files /dev/null and b/build/favicon.ico differ diff --git a/build/index.html b/build/index.html new file mode 100644 index 0000000000000000000000000000000000000000..971eccede684ce2aae0ceffb83ba6e534ae17661 --- /dev/null +++ b/build/index.html @@ -0,0 +1 @@ +