Giter Site home page Giter Site logo

ocurrent / ocaml-docs-ci Goto Github PK

View Code? Open in Web Editor NEW
19.0 11.0 13.0 849 KB

CI building documentation for ALL versions of ALL packages !

Home Page: https://docs.ci.ocaml.org

Makefile 0.69% OCaml 94.09% Standard ML 0.03% Cap'n Proto 1.35% Dockerfile 1.95% Shell 1.90%

ocaml-docs-ci's Introduction

Docs CI

OCaml-CI Build Status

OCaml Docs CI (aka ocaml-docs-ci or just docs-ci) is an OCurrent pipeline used to build the documentation for ocaml.org website. It uses the metadata from opam-repository to work out how to build documentation for individual packages using voodoo, the OCaml package documentation generator, and generates a HTML output suitable for ocaml.org server.

Installation

Get the code with:

git clone --recursive https://github.com/ocurrent/ocaml-docs-ci.git
cd ocaml-docs-ci

Note: you need to clone with --recursive because this project uses submodules (it depends on some packages that aren't released yet). If you forget, git submodule update --init will fetch them.

Then you need an opam 2.1 switch using OCaml 4.14. Recommend using this command to setup a local switch just for docs-ci.

# Create a local switch with packages and test dependencies installed
opam switch create . 4.14.1 --deps-only --with-test -y

# Run the build
dune build

# Run the tests
dune build @runtest

Architecture

At a high level docs-ci purpose is to compile the documentation of every package in the opamverse. To do this it generates a dependency universe. For each package (along with the version), the documentation is generated for it plus all of its dependencies. This documentation is then collected into a documentation set and provided to the ocaml.org service. The voodoo tool defines the on disk format for the documentation set.

For further details on how docs-ci works read the pipeline diagram.

Deployment

ocaml-docs-ci is deployed as into two environments, with ocurrent-deployer. The application is deployed as a series of Docker containers from a git branch.

Environments:

Environment www pipeline git branch data voodoo branch
Production https://ocaml.org https://docs.ci.ocaml.org live http://docs-data.ocaml.org main
Staging https://staging.ocaml.org https://staging.docs.ci.ocaml.org staging http://staging.docs-data.ocaml.org staging

OAuth integration provided by GitHub OAuth Apps hosted under the OCurrent organisation. See https://github.com/organizations/ocurrent/settings/applications

The infrastructure for docs-ci is managed via Ansible, contact @tmcgilchrist or @mtelvers if you need access or have questions.

To deploy a new version of docs-ci:

  1. Create a PR and wait for the GH Checks to run (ocaml-ci compiles the code and ocurrent-deployer checks it can build the Dockerfiles for the project)
  2. Test the changes on staging environment by git cherry picking the commits to that branch and pushing it
  3. Check deploy.ci.ocaml.org for docs-ci

Follow a similar process for live exercising extra caution as it could impact the live ocaml.org service.

The git history on live and staging MUST be kept in sync with the default branch. Those branches should be the same as main plus or minus some commits from a PR.

Remote API

docs-ci has a cli tool (ocaml-docs-ci-client) for interacting with the pipeline over CapnP. It provides commands to:

  • diff-pipelines - to show the changes between two pipeline runs
  • health-check - to provide information about a specific pipeline run
  • status - build status of a package
  • status-by-pipeline - build status of a package in the two most recent pipeline runs
  • steps - build steps of a package

The output is via json, which is intended to be combined with jq to display and query for pieces of information.

Local Development

ocaml-docs-ci is runable as:

dune exec -- ocaml-docs-ci \
    --ocluster-submission cap/XXX.cap \
    --ssh-host ci.mirage.io \
    --ssh-user docs \
    --ssh-privkey cap/id_rsa \
    --ssh-pubkey cap/id_rsa.pub \
    --ssh-folder /data/ocaml-docs-ci \
    --ssh-endpoint https://ci.mirage.io/staging \
    --jobs 6 \
    --filter mirage \
    --limit 6

A docker-compose.yml is provided to setup an entire docs-ci environment including:

  • ocluster scheduler
  • ocluster Linux x86 worker
  • nginx webserver for generated docs
  • ocaml-docs-ci built from the local git checkout

Run this command to create an environment:

$ docker-compose -f docker-compose.yml up

You should then be able to watch the pipeline in action at http://localhost:8080.

Migrations

Migrations are managed using omigrate. If you are using an opam switch for ocaml-docs-ci then omigrate should be installed and you can create a new migration by doing this from the project root:

$ omigrate create --dir migrations <migration-name>

This will create timestamped files in the migrations directory that you can then populate with the sql necessary to introduce and remove the migration (in the up and down files respectively).

Migrations will not run unless the --migration-path flag is present when invoking ocaml-docs-ci-service.

Epoch management

Epochs are used in ocaml-docs-ci to organise sets of artifacts all produced by the same odoc/voodoo version. There is a cli tool for managing epochs described in epoch.md.

ocaml-docs-ci's People

Contributors

avsm avatar dra27 avatar jonludlam avatar maiste avatar moyodiallo avatar mtelvers avatar novemberkilo avatar sabine avatar talex5 avatar thelortex avatar tmattio avatar tmcgilchrist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ocaml-docs-ci's Issues

Pin voodoo instead of odoc

The pipeline is currently pining odoc and depends on the main branch of voodoo. However, voodoo has constraints on the version of odoc. We should pin voodoo instead.

Generate documentation from CapnP schema files

The CapnP schema file represents the true API between ocaml-docs-ci and the consumers of it like cli tools or other services like ocaml.org website. It should be possible to generate HTML/markdown/mld documentation from the schema file.
Similar tools exist for gRPC / protobuf and we would like one to exist for CapnP.

Missing data dependency between prep and compile stages

There is a missing data dependency between prep and compile stages when building package documentation. For example on cohttp-lwt-unix.4.1.1
Screenshot 2023-05-22 at 12 10 41

When it tries to rsync the universes used in the compile step, sometimes they don't exist. The pipeline should know whether they exist and re-run the equivalent prep step to produce them. Manually re-running the right prep step unblocks the pipeline to continue.

Some packages with system package dependencies are broken

Some Opam packages docs having system package dependencies are broken, I found three of them:

There's probably more. Additionally, those dependencies are OS/distro dependent. For instance, the three mentioned above are Ubuntu dependencies. Package termbox is not broken although it has a system depency (on Python).

Move voodoo to OCaml.org or ocaml-docs-ci

OCaml.org is split into three repositories:

  • OCaml.org
  • Voodoo
  • ocaml-docs-ci

This makes maintenance more complicated than it needs to be and increases the entry bar for new contributors for seemingly no added value. While the docs pipeline should probably remain separated from OCaml.org, we can merge voodoo with one of the other repositories. I'm in favour of moving it to the ocaml-docs-ci repository as it is essentially defining the behaviour of the pipeline, so it seems like a better separation of concerns.

Add retry mechanism to resolve transient failures

From ocaml/ocaml.org#588 (Documentation generation failed for temporary reasons):

seems like a temporary issue [...], so it would be good to have a way to detect this and attempt to re-run it at a later point in time.

I'm opening this issue so that I can close the downstream issue on ocaml/ocaml.org.

When host keys change, the symlink-folder job fails

This specific instance of the problem has already been resolved by @mtelvers.

I am only documenting this here since I saw this happen before, and I expect the issue will arise again in the future.

Trying to promote current to live on docs-ci :
https://docs.ci.ocaml.org/job/2023-07-24/044701-symlink-folder-fcd5be
https://docs.ci.ocaml.org/job/2023-07-24/044701-symlink-folder-c3cf70

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:T9K4Jiv2xv21hVfxgM/tTviv3aoEtg7UmJ1cSIvH6PI.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:1
  remove with:
  ssh-keygen -f "/root/.ssh/known_hosts" -R "[docs.ci.ocaml.org]:2222"
ECDSA host key for [docs.ci.ocaml.org]:2222 has changed and you have requested strict checking.
Host key verification failed.

I remember I saw this before. When the host key changes, it is impossible to promote the current epoch to live status via the docs.ci.ocaml.org interface

Status page and reporting

It would be useful to have visibility on the packages that can't be generated. We could have a status page that lists the status of each packages, and send notifications to report build failures

Cluster builds using Dockerfiles fail

Running docs-ci using CI_PROFILE=docker seems like the Dockerfile submitted is poorly defined. Changing it over to production or dev which uses obuilder specs fixed the issue. The step command for creating the prep/universes is causing the error https://github.com/ocurrent/ocaml-docs-ci/blob/main/src/lib/storage.ml#L42-L51

Logs:

#21 [stage-1 13/13] RUN --mount=type=secret,id=ssh_privkey,target=/home/opam/.ssh/id_rsa,uid=1000 --mount=type=secret,id=ssh_pubkey,target=/home/opam/.ssh/id_rsa.pub,uid=1000 --mount=type=secret,id=ssh_config,target=/home/opam/.ssh/config,uid=1000 (echo '0.834307') && (for DATA in prep/universes/7d8209269530ba031e0dae5415095ca4/topkg/1.0.7,topkg.1.0.7-7d8209269530ba031e0dae5415095ca4,topkg.1.0.7 prep/universes/efb7484280b8d1f8589b4b784d9b12a9/stdint/0.7.2,stdint.0.7.2-efb7484280b8d1f8589b4b784d9b12a9,stdint.0.7.2 prep/universes/b4ff2927357c9ead2679e5d779bd6414/ocamlfind/1.9.6,ocamlfind.1.9.6-b4ff2927357c9ead2679e5d779bd6414,ocamlfind.1.9.6 prep/universes/b4ff2927357c9ead2679e5d779bd6414/ocamlbuild/0.14.2,ocamlbuild.0.14.2-b4ff2927357c9ead2679e5d779bd6414,ocamlbuild.0.14.2 prep/universes/7c62a60b0db47a8cfb2eaa2f159ef861/ocaml-config/2,ocaml-config.2-7c62a60b0db47a8cfb2eaa2f159ef861,ocaml-config.2 prep/universes/d41d8cd98f00b204e9800998ecf8427e/ocaml-base-compiler/4.14.1,ocaml-base-compiler.4.14.1-d41d8cd98f00b204e9800998ecf8427e,ocaml-base-compiler.4.14.1 prep/universes/f93dc14fbe1cce67b64997e50ae3afca/ocaml/4.14.1,ocaml.4.14.1-f93dc14fbe1cce67b64997e50ae3afca,ocaml.4.14.1 prep/universes/b093f767a90d63c3c3b7c16a04bfe363/logs/0.7.0,logs.0.7.0-b093f767a90d63c3c3b7c16a04bfe363,logs.0.7.0 prep/universes/7327e140e1aeb42b7944e88e03dcc002/fmt/0.9.0,fmt.0.9.0-7327e140e1aeb42b7944e88e03dcc002,fmt.0.9.0 prep/universes/51262f1934f91269be94879aa270c8f5/dune/3.7.1,dune.3.7.1-51262f1934f91269be94879aa270c8f5,dune.3.7.1 prep/universes/d41d8cd98f00b204e9800998ecf8427e/base-unix/base,base-unix.base-d41d8cd98f00b204e9800998ecf8427e,base-unix.base prep/universes/d41d8cd98f00b204e9800998ecf8427e/base-threads/base,base-threads.base-d41d8cd98f00b204e9800998ecf8427e,base-threads.base prep/universes/cf0775d03f6860fb1b43568215b623bd/astring/0.8.5,astring.0.8.5-cf0775d03f6860fb1b43568215b623bd,astring.0.8.5 prep/universes/cf0775d03f6860fb1b43568215b623bd/asetmap/0.8.1,asetmap.0.8.1-cf0775d03f6860fb1b43568215b623bd,asetmap.0.8.1 prep/universes/a9d75d19645e80b713ef642efaa79858/capnp-rpc/1.2.3,capnp-rpc.1.2.3-a9d75d19645e80b713ef642efaa79858,capnp-rpc.1.2.3; do IFS=","; set -- $DATA; ([ -d $1 ] || (echo "FAILED:$2" && mkdir -p $1 && cp ~/opam.err.log $1 && opam show $3 --raw > $1/opam)) && (shopt -s nullglob && ((tar -cvf $1.tar $1/*  && rm -R $1/* && mv $1.tar $1/content.tar) || (echo 'Empty directory'))) done) && (for DATA in prep/universes/7d8209269530ba031e0dae5415095ca4/topkg/1.0.7,topkg.1.0.7-7d8209269530ba031e0dae5415095ca4,topkg.1.0.7 prep/universes/efb7484280b8d1f8589b4b784d9b12a9/stdint/0.7.2,stdint.0.7.2-efb7484280b8d1f8589b4b784d9b12a9,stdint.0.7.2 prep/universes/b4ff2927357c9ead2679e5d779bd6414/ocamlfind/1.9.6,ocamlfind.1.9.6-b4ff2927357c9ead2679e5d779bd6414,ocamlfind.1.9.6 prep/universes/b4ff2927357c9ead2679e5d779bd6414/ocamlbuild/0.14.2,ocamlbuild.0.14.2-b4ff2927357c9ead2679e5d779bd6414,ocamlbuild.0.14.2 prep/universes/7c62a60b0db47a8cfb2eaa2f159ef861/ocaml-config/2,ocaml-config.2-7c62a60b0db47a8cfb2eaa2f159ef861,ocaml-config.2 prep/universes/d41d8cd98f00b204e9800998ecf8427e/ocaml-base-compiler/4.14.1,ocaml-base-compiler.4.14.1-d41d8cd98f00b204e9800998ecf8427e,ocaml-base-compiler.4.14.1 prep/universes/f93dc14fbe1cce67b64997e50ae3afca/ocaml/4.14.1,ocaml.4.14.1-f93dc14fbe1cce67b64997e50ae3afca,ocaml.4.14.1 prep/universes/b093f767a90d63c3c3b7c16a04bfe363/logs/0.7.0,logs.0.7.0-b093f767a90d63c3c3b7c16a04bfe363,logs.0.7.0 prep/universes/7327e140e1aeb42b7944e88e03dcc002/fmt/0.9.0,fmt.0.9.0-7327e140e1aeb42b7944e88e03dcc002,fmt.0.9.0 prep/universes/51262f1934f91269be94879aa270c8f5/dune/3.7.1,dune.3.7.1-51262f1934f91269be94879aa270c8f5,dune.3.7.1 prep/universes/d41d8cd98f00b204e9800998ecf8427e/base-unix/base,base-unix.base-d41d8cd98f00b204e9800998ecf8427e,base-unix.base prep/universes/d41d8cd98f00b204e9800998ecf8427e/base-threads/base,base-threads.base-d41d8cd98f00b204e9800998ecf8427e,base-threads.base prep/universes/cf0775d03f6860fb1b43568215b623bd/astring/0.8.5,astring.0.8.5-cf0775d03f6860fb1b43568215b623bd,astring.0.8.5 prep/universes/cf0775d03f6860fb1b43568215b623bd/asetmap/0.8.1,asetmap.0.8.1-cf0775d03f6860fb1b43568215b623bd,asetmap.0.8.1 prep/universes/a9d75d19645e80b713ef642efaa79858/capnp-rpc/1.2.3,capnp-rpc.1.2.3-a9d75d19645e80b713ef642efaa79858,capnp-rpc.1.2.3; do IFS=","; set -- $DATA; rsync -aR --no-p ./$1 172.17.0.1:/data/.; done) && (for DATA in prep/universes/7d8209269530ba031e0dae5415095ca4/topkg/1.0.7,topkg.1.0.7-7d8209269530ba031e0dae5415095ca4,topkg.1.0.7 prep/universes/efb7484280b8d1f8589b4b784d9b12a9/stdint/0.7.2,stdint.0.7.2-efb7484280b8d1f8589b4b784d9b12a9,stdint.0.7.2 prep/universes/b4ff2927357c9ead2679e5d779bd6414/ocamlfind/1.9.6,ocamlfind.1.9.6-b4ff2927357c9ead2679e5d779bd6414,ocamlfind.1.9.6 prep/universes/b4ff2927357c9ead2679e5d779bd6414/ocamlbuild/0.14.2,ocamlbuild.0.14.2-b4ff2927357c9ead2679e5d779bd6414,ocamlbuild.0.14.2 prep/universes/7c62a60b0db47a8cfb2eaa2f159ef861/ocaml-config/2,ocaml-config.2-7c62a60b0db47a8cfb2eaa2f159ef861,ocaml-config.2 prep/universes/d41d8cd98f00b204e9800998ecf8427e/ocaml-base-compiler/4.14.1,ocaml-base-compiler.4.14.1-d41d8cd98f00b204e9800998ecf8427e,ocaml-base-compiler.4.14.1 prep/universes/f93dc14fbe1cce67b64997e50ae3afca/ocaml/4.14.1,ocaml.4.14.1-f93dc14fbe1cce67b64997e50ae3afca,ocaml.4.14.1 prep/universes/b093f767a90d63c3c3b7c16a04bfe363/logs/0.7.0,logs.0.7.0-b093f767a90d63c3c3b7c16a04bfe363,logs.0.7.0 prep/universes/7327e140e1aeb42b7944e88e03dcc002/fmt/0.9.0,fmt.0.9.0-7327e140e1aeb42b7944e88e03dcc002,fmt.0.9.0 prep/universes/51262f1934f91269be94879aa270c8f5/dune/3.7.1,dune.3.7.1-51262f1934f91269be94879aa270c8f5,dune.3.7.1 prep/universes/d41d8cd98f00b204e9800998ecf8427e/base-unix/base,base-unix.base-d41d8cd98f00b204e9800998ecf8427e,base-unix.base prep/universes/d41d8cd98f00b204e9800998ecf8427e/base-threads/base,base-threads.base-d41d8cd98f00b204e9800998ecf8427e,base-threads.base prep/universes/cf0775d03f6860fb1b43568215b623bd/astring/0.8.5,astring.0.8.5-cf0775d03f6860fb1b43568215b623bd,astring.0.8.5 prep/universes/cf0775d03f6860fb1b43568215b623bd/asetmap/0.8.1,asetmap.0.8.1-cf0775d03f6860fb1b43568215b623bd,asetmap.0.8.1 prep/universes/a9d75d19645e80b713ef642efaa79858/capnp-rpc/1.2.3,capnp-rpc.1.2.3-a9d75d19645e80b713ef642efaa79858,capnp-rpc.1.2.3; do IFS=","; set -- $DATA; HASH=$((sha256sum $1/content.tar | cut -d " " -f 1)  || echo -n 'empty'); printf "HASHES:$2:$HASH\n"; done)
#21 0.830 /bin/sh: 1: Syntax error: Missing '))'

Application and Operational Metrics

ocaml-docs-ci should report on application and operational level metrics via prometheus/grafana.
Screenshot 2023-05-19 at 12 16 18

  • Production dashboard in grafana for https://docs.ci.ocaml.org
  • Staging dashboard in grafana for https://staging.docs.ci.ocaml.org
  • Setup ocluster connection to export stats (it already supports prometheus)
  • Add stat exports to docs-ci solver
  • Add stats export to monitor.ml.
  • Setup ocurrent to export stats (it already supports prometheus)
  • Add host monitoring for storage and web server containers. Alert on disk space usage over 80%.
  • Add ocurrent support for exporting Node creation/update/destroy metrics (as a proxy for graph size)

Non-exhaustive list of tasks to cover the monitoring of ocaml-docs-ci application.

Use the solver pool

This will allow us to scale down the machine used to generate the documentation since all the processing is for the solver.

OCaml Docs CI WIP

Sharing my personal list of things that need working on for ocaml-docs-ci:

  • Application and Operational Metrics #94. Metrics required:
    • accurate package status for current pipeline
    • package status across pipelines
    • reverse dependencies for universes (Tell which things to rebuild to un-block the most packages).
  • Update obuilder specs to use Opam 2.1 syntax #158
  • Why is prep and compile shared between Epochs? How can we remove un-used universes in there? #161
  • Cache-less ocluster-worker for running local docker instances. Useful for testing docker-compose where you don't care about caching.
  • pipeline should ignore rc, alpha, beta and all non-official releases for the purposes of building docs
  • Need a tool to diff Epochs. What things are newly failing vs always failing? Related to #161
  • Need a list of failing packages, validate what has never built or will not ever build. So we can ignore them in future.
  • Write up documentation for Epochs and their linking jobs.
  • Debug SVG stack overflow issue for ocurrent in docs-ci ocurrent/ocurrent#435
  • Why is docs-ci considering rc, alpha and non-official releases of OCaml, or very very old versions like 3.07 (https://docs.ci.ocaml.org/job/2023-10-09/001942-docker-peek-b45346)
  • Use the solver pool #86
  • Missing data dependency between prep and compile #121 requires manual intervention when downstream jobs update.
  • Prioritise building more recent packages #137
  • Build package documentation for Windows specific packages (or other non-Linux platforms)
  • Versioning of voodoo outputs and general meta-data about how an Epoch was generated

Use publishers instead of builders for prep / compile / gen

Currently, we're using Current_cache.Make (https://ocurrent.org/current/Current_cache/Make/index.html) to cache builds.
However, some situations might lead into inconsistencies between the data server and the ocurrent state:

  • compile package a.1.0 with voodoo version x: outputs files into p/a/1.0 and obtain the hash h-x
  • compile package a.1.0 with voodoo version y: outputs files into p/a/1.0 and obtain a new hash h-y
  • rollback voodoo and thus compile package a.1.0with voodoo version x: cache hit, no rebuild, returns hash h-x even if the hash of the files on the server is still h-y

Current_cache.Output (https://ocurrent.org/current/Current_cache/Output/index.html) is more appropriate to reflect what we're doing. In the previous example, the key would be a.1.0 and the value the voodoo version.

Make logs from `live` switch visible

IMG_20230613_173143

In order to allow inspecting why packages failed on ocaml.org, when the pipeline is still running after a voodoo upgrade, it would be useful to have access to the logs of the live packages.

Ocaml.org needs a way to safely receive breaking changes to the data format emitted by voodoo

As I understand it at the moment, updating voodoo to the new data format means that, some moment around 24-48 hours in the future, suddenly, ocaml.org will break and needs someone to quickly jump and apply the patch to make ocaml.org able to consume the new data format.

If that happens in an inconvenient moment, that could be problematic.

If, unexpectedly, there are issues with a large number of packages' generated documentation, we may need to roll back and apply a fix. However, we don't seem to have a way to do that after the pipeline switches the live-folder.

I may be completely mistaken on this, and if I am, would be glad for someone to point out if there's an intended way to do these kinds of breaking data-format changes.

This is the root problem behind ocaml/infrastructure#18, #87, and #85 and the underlying reason why we still don't have the missing preambles back in the package documentation.

Solver failure on learn-ocaml.0.14.1

The solver query should be considering OCaml versions from 4.04.1 onwards but appears to reject learn-ocaml.0.14.1. Investigate what is going on?

https://docs.ci.ocaml.org/package/learn-ocaml.0.14.1

Logs:

Error from solver: Bad frame from worker: time="1.23" len="0.0"
no platform:
2023-01-12 13:29.33 [INFO] Solving for ocaml-base-compiler, learn-ocaml

2023-01-12 13:29.35 [INFO] base: eliminated all possibilities in 0.91 s

2023-01-12 13:29.35 [INFO] = base =

2023-01-12 13:29.35 [INFO] Can't find all required versions.
Selected: base-bigarray.base base-domains.base base-nnp.base
          base-threads.base base-unix.base ocaml-config.3
          ocaml-options-vanilla.1 ocaml-base-compiler&learn-ocaml
          ocaml-base-compiler ocaml-base-compiler ocaml base-domains
          ocaml-base-compiler
- learn-ocaml -> (problem)
    User requested = 0.14.1
    Rejected candidates:
      learn-ocaml.0.14.1: Requires ocaml >= 4.12 & < 4.13~
- ocaml -> ocaml.5.0.0
    ocaml-base-compiler 5.0.0~beta1 requires = 5.0.0
- ocaml-base-compiler -> ocaml-base-compiler.5.0.0~beta1
    User requested = 5.0.0~beta1

Building Docs for Packages When Depext is Unavailable

Opam plugin "depext" may require upgrading/reinstalling. Reinstall the plugin on the current switch? [Y/n] y
The following actions will be performed:
  - recompile opam-depext 1.2.1-1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> retrieved opam-depext.1.2.1-1  (cached)
-> removed   opam-depext.1.2.1-1
-> installed opam-depext.1.2.1-1
Done.

<><> opam-depext.1.2.1-1 installed successfully <><><><><><><><><><><><><><><><>
=> opam-depext is unnecessary when used with opam >= 2.1. Please use opam install directly instead
# Run eval $(opam env) to update the current shell environment

<><> Carrying on to "opam depext -viy llvm.15.0.7+nnp-2 stdlib-shims.0.3.0 integers.0.7.0 dune-configurator.3.10.0 dune.3.10.0 ctypes.0.21.1 csexp.1.5.2 conf-llvm.15 conf-bash.1 bigarray-compat.1.1.0" 

You are using opam 2.1+, where external dependency handling has been integrated: consider calling opam directly, the 'depext' plugin interface is provided for backwards compatibility only
# Detecting depexts using vars: arch=x86_64, os=linux, os-distribution=debian, os-family=debian
[ERROR] No solution for llvm.15.0.7+nnp-2 & stdlib-shims.0.3.0 & integers.0.7.0 & dune-configurator.3.10.0 & dune.3.10.0 & ctypes.0.21.1 & csexp.1.5.2 & conf-llvm.15 & conf-bash.1 & bigarray-compat.1.1.0:   * Missing dependency:
            - conf-llvm >= 15
            depends on the unavailable system package 'llvm-15-dev'. Use `--no-depexts' to attempt installation anyway, or it is possible that a depext package name in the opam file is incorrect.


Command failed: opam --cli=2.1 list --readonly --external '--resolve=llvm.15.0.7+nnp-2,stdlib-shims.0.3.0,integers.0.7.0,dune-configurator.3.10.0,dune.3.10.0,ctypes.0.21.1,csexp.1.5.2,conf-llvm.15,conf-bash.1,bigarray-compat.1.1.0' returned 20

From https://ocaml.org/p/llvm/latest/doc/index.html

Would it be possible to install a package without the depext just for the purpose of generating documentation?

If not, I think this means we need more images on which to build, so that depexts can be installed.

Stackoverflow in src/solver/solver.ml when running solve without cache.

This seems to only appear on docs.ci.ocaml.org, which makes sense because it is handling the entire opam-repository set of packages as compared to staging which only builds the latest version of each package.

infra_docs-ci.1.76qh2d0e8wgg@eumache    | Called from Dune__exe__Solver.universes.aux in file "src/solver/solver.ml", line 48, characters 10-294
infra_docs-ci.1.76qh2d0e8wgg@eumache    | Called from Dune__exe__Solver.universes.aux.(fun) in file "src/solver/solver.ml", line 53, characters 62-71
infra_docs-ci.1.76qh2d0e8wgg@eumache    | Called from Stdlib__List.rev_map.rmap_f in file "list.ml", line 103, characters 22-25
infra_docs-ci.1.76qh2d0e8wgg@eumache    | Called from Dune__exe__Solver.universes.aux in file "src/solver/solver.ml", line 48, characters 10-294
infra_docs-ci.1.76qh2d0e8wgg@eumache    | Called from Dune__exe__Solver.universes.aux.(fun) in file "src/solver/solver.ml", line 53, characters 62-71
infra_docs-ci.1.76qh2d0e8wgg@eumache    | Called from Stdlib__List.rev_map.rmap_f in file "list.ml", line 103, characters 22-25
infra_docs-ci.1.76qh2d0e8wgg@eumache    | Called from Dune__exe__Solver.universes.aux in file "src/solver/solver.ml", line 48, characters 10-294
infra_docs-ci.1.76qh2d0e8wgg@eumache    | Called from Dune__exe__Solver.universes.aux.(fun) in file "src/solver/solver.ml", line 53, characters 62-71

Mirage >= 4.0.0 packages documentation are not passing through the solver step

I was wondering why mirage >= 4.0.0 packages were not build.
Looking at the solver logs:

Selected: base-bigarray.base base-domains.base base-nnp.base
          base-threads.base base-unix.base ocaml-config.3
          ocaml-options-vanilla.1 ocaml-base-compiler&mirage
          ocaml-base-compiler ocaml-base-compiler ocaml base-domains
          ocaml-base-compiler
- mirage -> (problem)
    User requested = 4.1.1
    No usable implementations:
      mirage.4.2.0: Rejected by user-specified constraint mirage (= 4.1.1)
      mirage.4.1.1: Availability condition not satisfied
      mirage.4.1.0: Rejected by user-specified constraint mirage (= 4.1.1)
      mirage.4.0.0: Rejected by user-specified constraint mirage (= 4.1.1)
      mirage.4.0.0~beta3: Rejected by user-specified constraint mirage (= 4.1.1)
      ...
- ocaml -> ocaml.5.0.0
    ocaml-base-compiler 5.0.0~alpha1 requires = 5.0.0
- ocaml-base-compiler -> ocaml-base-compiler.5.0.0~alpha1
    User requested >= 4.02.3
- ocaml-beta -> (problem)
    No usable implementations:
      ocaml-beta.disabled: Availability condition not satisfie

I figured out that the availability condition in mirage's opam file is not met as the opam-version variable is not set (or set to something less than 2.1.0)

available: opam-version >= "2.1.0"

So when calling the solver it might be useful to set that variable !

Prioritise building more recent packages

Starting a discussion here about what should happen with building older version of packages. Currently we attempt to build everything in opam-repository which includes a number of older packages that are of questionable usefulness.

For example:

  • older Tezos releases
  • older JaneStreet base/core libraries

Prioritise building the more recent versions of packages.
What are the OCaml versions that we support package documentation for?
Can we keep the last successful documentation build for older releases and not rebuild them?

ocaml/opam-repository#23649

Disk space usage of pipelines

ocaml-docs-ci uses a concept of Epochs to track sets of package documentation that interlink and share common dependencies. Each Epoch is self-contained and can grow to 100G or more for production.

When they are no longer used Epochs can be removed and the disk space reclaimed. Outside of epochs two directories compile and prep also take up a lot of disk space. But there is no clean way of reclaiming the un-used diskspace from them. For example on live docs.ci.ocaml.org they look like:

$ ls -l
total 940
drwxr-xr-x 4 localadmin localadmin   4096 Oct 12 17:50 compile
-rw-r--r-- 1 root       root       459760 Jan  3  2023 content.current
-rw-r--r-- 1 root       root       450418 Jan  3  2023 content.live
drwxr-xr-x 3 localadmin localadmin   4096 Aug 11 10:58 epoch-51470fc39ff110dfccafc8f0f1d882ec
drwxr-xr-x 3 localadmin localadmin   4096 Oct 12 17:50 epoch-5daeecab2ad7a2d07a12742d4cc0ab6f
drwxr-xr-x 3 localadmin localadmin   4096 Aug 11 12:23 epoch-804419edbd92ec13bc06b69d15132959
drwxr-xr-x 3 localadmin localadmin   4096 Oct 12 17:51 epoch-ae8bf595b8594945ee40c58377e03730
drwxr-xr-x 3 localadmin localadmin   4096 Jul 20 09:44 epoch-c96e56dbd72372ea5f56e27e667243ea
lrwxrwxrwx 1 root       root           44 Aug 16 05:48 html-current -> /data/epoch-ae8bf595b8594945ee40c58377e03730
-rw-r--r-- 1 root       root         1365 Aug 16 05:48 html-current.log
lrwxrwxrwx 1 root       root           44 Sep  7 13:56 html-live -> /data/epoch-ae8bf595b8594945ee40c58377e03730
-rw-r--r-- 1 root       root         1028 Sep  7 13:56 html-live.log
drwxr-xr-x 2 root       root         4096 Aug 25  2022 linked
lrwxrwxrwx 1 root       root           44 Aug 16 05:48 linked-current -> /data/epoch-5daeecab2ad7a2d07a12742d4cc0ab6f
-rw-r--r-- 1 root       root         1690 Aug 16 05:48 linked-current.log
lrwxrwxrwx 1 root       root           44 Sep  7 13:56 linked-live -> /data/epoch-5daeecab2ad7a2d07a12742d4cc0ab6f
-rw-r--r-- 1 root       root          585 Sep  7 13:56 linked-live.log
lrwxrwxrwx 1 root       root            9 Jul 21  2021 live -> html-live
drwxr-xr-x 3 localadmin localadmin   4096 Oct 12 17:45 prep

$ du -skhc *
159G	compile
452K	content.current
440K	content.live
94G	epoch-51470fc39ff110dfccafc8f0f1d882ec
28G	epoch-5daeecab2ad7a2d07a12742d4cc0ab6f
59G	epoch-804419edbd92ec13bc06b69d15132959
47G	epoch-ae8bf595b8594945ee40c58377e03730
103G	epoch-c96e56dbd72372ea5f56e27e667243ea
0	html-current
4.0K	html-current.log
0	html-live
4.0K	html-live.log
4.0K	linked
0	linked-current
4.0K	linked-current.log
0	linked-live
4.0K	linked-live.log
0	live
551G	prep
1.1T	total

Both directories appear to contain universes but they aren't linked to a specific Epoch and can't be easily pruned.
Further investigation is required to work out how we can reclaim disk space or organise these directories into epochs so they can be reclaimed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.