Repository navigation
updated Docker files - #171
Conversation
| # Gym | ||
| RUN sudo apt-get -y install zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libsdl2-dev swig wget | ||
| FROM ray-project/deploy | ||
| RUN conda install -y -c conda-forge tensorflow |
There was a problem hiding this comment.
Just curious, why install tensorflow this way instead of via pip?
There was a problem hiding this comment.
This is the suggested command for installation on Anaconda given on the Tensorflow page:
https://www.tensorflow.org/get_started/os_setup#anaconda_installation
I had tried using the pip install but encountered errors.
| FROM ubuntu:xenial | ||
| RUN apt-get update | ||
| RUN apt-get install -y vim git wget | ||
| RUN apt-get install -y cmake build-essential autoconf curl libtool libboost-all-dev unzip |
There was a problem hiding this comment.
I believe best practice for Dockerfiles is to combine stuff into one big command and remove the temporary files, e.g., something like the following (taken from https://github.com/openai/gym/blob/master/Dockerfile)
RUN apt-get update \
&& apt-get install -y libav-tools \
python-numpy \
python-scipy \
python-pyglet \
python-setuptools \
libpq-dev \
libjpeg-dev \
curl \
cmake \
swig \
python-opengl \
libboost-all-dev \
libsdl2-dev \
wget \
unzip \
git \
xpra \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& easy_install pip
There was a problem hiding this comment.
Ok, I'm updating this. It looks like the temporary files removed are pretty small in this case (already dealing with Anaconda on one line) but I'd like to stick with the pattern.
…ReDoc (#65460) > **Stacked PR.** Targets `doc-1513-declare-openapi-303` (#65458), which targets #65457. Review order is #65457 → #65458 → this. GitHub retargets automatically as each merges. > > **Conflicts with #65456 by design.** That PR pins `redoc_uri` to a specific ReDoc version; this one deletes `redoc_uri` entirely. If #65456 lands first I'll resolve the conflict here. If this lands, #65456 becomes moot and should be closed. Either order works — #65456 is worth keeping as the safe fix in case this one stalls in review. ## Why this change is needed `sphinxcontrib-redoc` is unmaintained. 1.6.0 is the latest release and dates from 2020; the `2.0.0a1` alpha still imports `pkg_resources`. Keeping it costs this repo three things: | Cost | Location | | --- | --- | | A `setuptools<82` ceiling, because the extension imports `pkg_resources` at module load and setuptools 82 removed it | `doc/requirements-doc.txt` | | A `misc.copy_overwrite` entry in `suppress_warnings`, because the extension redundantly copies its own bundled asset | `doc/source/conf.py` | | The renderer fetched from a third-party CDN at page-view time | `doc/source/conf.py` | All of that buys exactly one page. The Jobs API spec is the only consumer: `conf.py` had one `redoc` entry and there's no other OpenAPI document in the repo. There's a second, larger reason. **The current page is a client-rendered JavaScript island.** ReDoc has no source file at all — the extension synthesizes `api.html` from `conf.py`. So today the page: - is in **no toctree**, and - is reachable only through a hardcoded `` `... <api.html>`_ `` link at `rest.rst:94`, and - has **none of its endpoint content in the built HTML**, so it can't participate in Sphinx search or cross-referencing. ## Related changes Fourth in the chain above. Supersedes the "record why we stay on ReDoc" PR (#65459), which I'll close — its conclusion is obsolete now that this works. ## What changes - Swap `sphinxcontrib.redoc` → `sphinxcontrib.openapi` (0.9.0) in `conf.py` and `doc/requirements-doc.txt`, and regenerate the deplock. - Add a real `api.md`, put it in the `job-submission` toctree, and replace the raw `<api.html>` link with a `:ref:`. - Drop the now-unneeded `misc.copy_overwrite` suppression. - Change two operation `summary` fields from YAML block scalars to plain scalars (see below). - Update the `setuptools` comment: the `<82` ceiling's cause is gone. The pin itself is left in place, since unpinning is a separate resolve worth verifying on its own. `sphinxcontrib-openapi` is pure Python, from the same `sphinx-contrib` org, and needs no `pkg_resources`. The deplock diff is `-sphinxcontrib-redoc` and `+sphinxcontrib-openapi` plus its five dependencies (`sphinxcontrib-httpdomain`, `sphinx-mdinclude`, `deepmerge`, `mistune`, `picobox`). ## Verification Built with `make -C doc rtd-build`, which runs the RtD-faithful clean build with `-W`, matching `fail_on_warning: true`: ``` build succeeded. ``` Exit 0, and **zero `WARNING:`/`ERROR:` lines in the whole log**. `raydepsets --check` on `docbuild_depset_311` reports "Lock files are up to date." Checked against the built `api.html` rather than inferred: | Check | Result | | --- | --- | | Request/response schemas rendered | Yes — `Request JSON Object` and `Response JSON Object` field lists, with `entrypoint`, `runtime_env`, `metadata`, and the rest, including types and required flags | | `$ref` and `allOf` resolution | Resolved, including through `JobDetails` | | Literal `**` on the page | None — zero docutils `problematic` nodes | | `http-routingtable` index | Generated | | Page in the sidebar, with prev/next pagination | Yes | | MyST page equivalent to the `.rst` draft it replaced | Yes — 8 httpdomain operation objects, identical `Parameters` / `Request JSON Object` / `Response JSON Object` / `Status Codes` field lists, no leaked rST, and both `:ref:` directions resolving with the right link text | ## Three non-obvious configuration details All three are commented at their sites in the diff, because all three fail quietly. **The renderer is selected via `openapi_default_renderer`, not by the directive spelling.** Writing `.. openapi:httpdomain::` in the page adds an `unknown directive name` warning, which is fatal under `fail_on_warning`. Selecting it in `conf.py` and using a plain `.. openapi::` avoids that. **The default renderer emits no request or response schemas at all** — just paths, parameters, and status codes. So leaving `openapi_default_renderer` unset would silently drop most of the reference content while still building green. That's the trap worth knowing about if anyone touches this later. **The `openapi` directive can't be a bare MyST fence; it has to be wrapped in `eval-rst`.** `sphinxcontrib-openapi` emits reStructuredText into a `ViewList` and hands it to `nested_parse`, but MyST's `nested_parse` renders that content as Markdown. A ```` ```{openapi} ```` fence therefore builds green with zero warnings while silently degrading the entire page: every `.. http:get::` and `:resjson:` line renders as literal text, so nothing becomes an httpdomain object and the page has no field lists, no anchors, and no search or cross-referencing. That's a worse failure than the one above, and just as quiet. ## Why the summary fields change `sphinxcontrib-openapi`'s renderer interpolates an operation's `summary` into `**...**` without stripping it. A YAML block scalar (`summary: |`) leaves a trailing newline in the value, so the markup opens on one line and closes on the next, docutils can't pair it, and readers see literal asterisks. Filed upstream as [sphinx-contrib/openapi#173](sphinx-contrib/openapi#173). Two operations used block scalars (`GET /api/version` and `POST /api/jobs`); the other six already used plain scalars. Converting those two is the whole fix and changes no rendered text. ## What this gives up, honestly **Request and response samples.** ReDoc rendered example payloads; this doesn't. It isn't a configuration choice — both routes to examples are blocked by upstream bugs, and I've confirmed each against this spec: - `:generate-examples-from-schemas:` crashes with `ValueError: dictionary update sequence element #0 has length 1; 2 is required` ([#166](sphinx-contrib/openapi#166)). Example generation can't handle an `allOf` that targets a non-object schema, which is exactly how `JobDetails` attaches descriptions to the `JobType` and `JobStatus` string enums. - `:response-examples-for:` is rejected as an unknown option ([#165](sphinx-contrib/openapi#165)). `api.md` carries a comment recording this so nobody re-derives it, and I've added the reproduction detail to both upstream issues. Weighed against gaining search, cross-referencing, navigation, a dependency that's actually maintained, and no third-party CDN at page-view time, losing sample payloads seemed like the right trade — but it is a real loss, and it's reasonable to want the upstream fixes first instead. I've also filed [#171](sphinx-contrib/openapi#171), [#172](sphinx-contrib/openapi#172), and [#173](sphinx-contrib/openapi#173), each with a minimal reproducer, and am planning PRs for them. ## Checks - [x] `make -C doc rtd-build`: build succeeded, zero warnings. - [x] `raydepsets --check`: lock files up to date. - [x] Built page inspected for schema content, `allOf`/`$ref` resolution, and stray markup. - [x] `pre-commit run` clean. - [x] Read the Docs preview reviewed for the appearance change. --------- Signed-off-by: Douglas Strodtman <[email protected]>
…ReDoc (ray-project#65460) > **Stacked PR.** Targets `doc-1513-declare-openapi-303` (ray-project#65458), which targets ray-project#65457. Review order is ray-project#65457 → ray-project#65458 → this. GitHub retargets automatically as each merges. > > **Conflicts with ray-project#65456 by design.** That PR pins `redoc_uri` to a specific ReDoc version; this one deletes `redoc_uri` entirely. If ray-project#65456 lands first I'll resolve the conflict here. If this lands, ray-project#65456 becomes moot and should be closed. Either order works — ray-project#65456 is worth keeping as the safe fix in case this one stalls in review. ## Why this change is needed `sphinxcontrib-redoc` is unmaintained. 1.6.0 is the latest release and dates from 2020; the `2.0.0a1` alpha still imports `pkg_resources`. Keeping it costs this repo three things: | Cost | Location | | --- | --- | | A `setuptools<82` ceiling, because the extension imports `pkg_resources` at module load and setuptools 82 removed it | `doc/requirements-doc.txt` | | A `misc.copy_overwrite` entry in `suppress_warnings`, because the extension redundantly copies its own bundled asset | `doc/source/conf.py` | | The renderer fetched from a third-party CDN at page-view time | `doc/source/conf.py` | All of that buys exactly one page. The Jobs API spec is the only consumer: `conf.py` had one `redoc` entry and there's no other OpenAPI document in the repo. There's a second, larger reason. **The current page is a client-rendered JavaScript island.** ReDoc has no source file at all — the extension synthesizes `api.html` from `conf.py`. So today the page: - is in **no toctree**, and - is reachable only through a hardcoded `` `... <api.html>`_ `` link at `rest.rst:94`, and - has **none of its endpoint content in the built HTML**, so it can't participate in Sphinx search or cross-referencing. ## Related changes Fourth in the chain above. Supersedes the "record why we stay on ReDoc" PR (ray-project#65459), which I'll close — its conclusion is obsolete now that this works. ## What changes - Swap `sphinxcontrib.redoc` → `sphinxcontrib.openapi` (0.9.0) in `conf.py` and `doc/requirements-doc.txt`, and regenerate the deplock. - Add a real `api.md`, put it in the `job-submission` toctree, and replace the raw `<api.html>` link with a `:ref:`. - Drop the now-unneeded `misc.copy_overwrite` suppression. - Change two operation `summary` fields from YAML block scalars to plain scalars (see below). - Update the `setuptools` comment: the `<82` ceiling's cause is gone. The pin itself is left in place, since unpinning is a separate resolve worth verifying on its own. `sphinxcontrib-openapi` is pure Python, from the same `sphinx-contrib` org, and needs no `pkg_resources`. The deplock diff is `-sphinxcontrib-redoc` and `+sphinxcontrib-openapi` plus its five dependencies (`sphinxcontrib-httpdomain`, `sphinx-mdinclude`, `deepmerge`, `mistune`, `picobox`). ## Verification Built with `make -C doc rtd-build`, which runs the RtD-faithful clean build with `-W`, matching `fail_on_warning: true`: ``` build succeeded. ``` Exit 0, and **zero `WARNING:`/`ERROR:` lines in the whole log**. `raydepsets --check` on `docbuild_depset_311` reports "Lock files are up to date." Checked against the built `api.html` rather than inferred: | Check | Result | | --- | --- | | Request/response schemas rendered | Yes — `Request JSON Object` and `Response JSON Object` field lists, with `entrypoint`, `runtime_env`, `metadata`, and the rest, including types and required flags | | `$ref` and `allOf` resolution | Resolved, including through `JobDetails` | | Literal `**` on the page | None — zero docutils `problematic` nodes | | `http-routingtable` index | Generated | | Page in the sidebar, with prev/next pagination | Yes | | MyST page equivalent to the `.rst` draft it replaced | Yes — 8 httpdomain operation objects, identical `Parameters` / `Request JSON Object` / `Response JSON Object` / `Status Codes` field lists, no leaked rST, and both `:ref:` directions resolving with the right link text | ## Three non-obvious configuration details All three are commented at their sites in the diff, because all three fail quietly. **The renderer is selected via `openapi_default_renderer`, not by the directive spelling.** Writing `.. openapi:httpdomain::` in the page adds an `unknown directive name` warning, which is fatal under `fail_on_warning`. Selecting it in `conf.py` and using a plain `.. openapi::` avoids that. **The default renderer emits no request or response schemas at all** — just paths, parameters, and status codes. So leaving `openapi_default_renderer` unset would silently drop most of the reference content while still building green. That's the trap worth knowing about if anyone touches this later. **The `openapi` directive can't be a bare MyST fence; it has to be wrapped in `eval-rst`.** `sphinxcontrib-openapi` emits reStructuredText into a `ViewList` and hands it to `nested_parse`, but MyST's `nested_parse` renders that content as Markdown. A ```` ```{openapi} ```` fence therefore builds green with zero warnings while silently degrading the entire page: every `.. http:get::` and `:resjson:` line renders as literal text, so nothing becomes an httpdomain object and the page has no field lists, no anchors, and no search or cross-referencing. That's a worse failure than the one above, and just as quiet. ## Why the summary fields change `sphinxcontrib-openapi`'s renderer interpolates an operation's `summary` into `**...**` without stripping it. A YAML block scalar (`summary: |`) leaves a trailing newline in the value, so the markup opens on one line and closes on the next, docutils can't pair it, and readers see literal asterisks. Filed upstream as [sphinx-contrib/openapi#173](sphinx-contrib/openapi#173). Two operations used block scalars (`GET /api/version` and `POST /api/jobs`); the other six already used plain scalars. Converting those two is the whole fix and changes no rendered text. ## What this gives up, honestly **Request and response samples.** ReDoc rendered example payloads; this doesn't. It isn't a configuration choice — both routes to examples are blocked by upstream bugs, and I've confirmed each against this spec: - `:generate-examples-from-schemas:` crashes with `ValueError: dictionary update sequence element #0 has length 1; 2 is required` ([ray-project#166](sphinx-contrib/openapi#166)). Example generation can't handle an `allOf` that targets a non-object schema, which is exactly how `JobDetails` attaches descriptions to the `JobType` and `JobStatus` string enums. - `:response-examples-for:` is rejected as an unknown option ([ray-project#165](sphinx-contrib/openapi#165)). `api.md` carries a comment recording this so nobody re-derives it, and I've added the reproduction detail to both upstream issues. Weighed against gaining search, cross-referencing, navigation, a dependency that's actually maintained, and no third-party CDN at page-view time, losing sample payloads seemed like the right trade — but it is a real loss, and it's reasonable to want the upstream fixes first instead. I've also filed [ray-project#171](sphinx-contrib/openapi#171), [ray-project#172](sphinx-contrib/openapi#172), and [ray-project#173](sphinx-contrib/openapi#173), each with a minimal reproducer, and am planning PRs for them. ## Checks - [x] `make -C doc rtd-build`: build succeeded, zero warnings. - [x] `raydepsets --check`: lock files up to date. - [x] Built page inspected for schema content, `allOf`/`$ref` resolution, and stray markup. - [x] `pre-commit run` clean. - [x] Read the Docs preview reviewed for the appearance change. --------- Signed-off-by: Douglas Strodtman <[email protected]>
## Description Bumps `sphinxcontrib-openapi`, which renders the [Ray Jobs REST API specification](https://docs.ray.io/en/master/cluster/running-applications/job-submission/api.html) page, from 0.9.0 to [0.10.0](https://pypi.org/project/sphinxcontrib-openapi/0.10.0/), and regenerates the docs deplock. 0.10.0 fixes five upstream bugs, two of which this page's source comment named as blockers for request and response examples: - [sphinx-contrib/openapi#166](sphinx-contrib/openapi#166): `:generate-examples-from-schemas:` crashed on an `allOf` that targets a non-object schema, which is how `JobDetails` attaches descriptions to the `JobType` and `JobStatus` enums. - [sphinx-contrib/openapi#165](sphinx-contrib/openapi#165): `:response-examples-for:` and the other whitespace-delimited options were rejected as unknown options. - [#173](sphinx-contrib/openapi#173), [#171](sphinx-contrib/openapi#171), and [#178](sphinx-contrib/openapi#178): an operation summary written as a YAML block scalar rendered literal `**`, the old renderer's request body block was left unclosed, and the 3.0 renderer crashed on a non-object request body. Examples still can't be enabled. With `:generate-examples-from-schemas:` on 0.10.0, the stop endpoint's 200 response, a bare `JobStatus` enum, renders as `PENDING` rather than `"PENDING"` under `Content-Type: application/json`. The `http` lexer rejects it, and the warning fails the build. That's [sphinx-contrib/openapi#172](sphinx-contrib/openapi#172), fixed for the `httpdomain` renderer on the open [sphinx-contrib/openapi#185](sphinx-contrib/openapi#185). This PR updates the source comment in `api.md` to name that bug instead of the two that are now fixed. The rendered page doesn't change. What changes: - `doc/requirements-doc.txt`: `sphinxcontrib-openapi==0.9.0` → `0.10.0`. - `python/deplocks/docs/docbuild_depset_py3.11.lock`: regenerated with raydepsets. The diff is the one package block. 0.10.0 declares the same dependencies as 0.9.0, so there's no transitive churn. - `doc/source/cluster/running-applications/job-submission/api.md`: source comment only. 0.10.0 raises `requires-python` from `>=3.10` to `>=3.11`. The only consumer is the docbuild depset, which is Python 3.11 on both Read the Docs and the `docbuild-py3.11` CI image. ## Related issues Related to sphinx-contrib/openapi#172. ## Additional information **Not a duplicate.** No open PR touches `sphinxcontrib-openapi` or bumps this pin, and no open Dependabot PR targets `doc/requirements-doc.txt`. **Tests run:** - `bazelisk run //ci/raydepsets:raydepsets -- build ci/raydepsets/configs/docs.depsets.yaml --name docbuild_depset_311` regenerated the lock. - `bazelisk run //ci/raydepsets:raydepsets -- build ci/raydepsets/configs/docs.depsets.yaml --check` passed for all three docs depsets. The doctest lock is unchanged. - `make -C doc rtd-build` in a Python 3.11 venv installed from `doc/requirements-doc.lock.txt`: `build succeeded.`, zero Sphinx warnings under `-W`. The `rtd-doctor` preflight confirmed the environment matches Read the Docs. The rendered Jobs API page has all 8 endpoints, including `/stop`. - The Jobs spec rendered standalone with `openapi_default_renderer = "httpdomain"` under `-W`: clean on 0.10.0 with no example options. With `:generate-examples-from-schemas:` it fails on the unquoted `PENDING`, which is the bug the updated comment describes. AI assistance (Claude Code) was used to prepare this change. I reviewed every changed line. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This change updates Docker files. Changes include: