Giter Site home page Giter Site logo

opam-health-check's Introduction

How to install opam-health-check:

$ opam pin add opam-health-check .

How to use opam-health-check locally:

For opam-health-check to work you need to start the server like so:

$ opam-health-serve --connect "$ocluster_cap" "$workdir"

For instance:

$ workdir=/tmp/opam-health-check
$ ocluster_cap="$HOME/ocluster.cap"
$ opam-health-serve --connect "$ocluster_cap" "$workdir"

Now simply use the opam-health-check command. First you need to initialize it like so:

$ opam-health-check init --from-local-workdir "$workdir"

Now you can send any command to the server using the opam-health-check command. All subcommands may be listed with opam-health-check --help

OCluster capability file

opam-health-check now uses OCluster for its daily use. This means you need access to an OCluster instance with its dedicated capability file, which is given to the server through the --connect option.

To set this up locally, you will need to get run the OCluster scheduler and one or more workers. The sequence of steps is:

  1. Run the OCluster scheduler probably with the public address tcp:127.0.0.1:9000.
  2. Use the OCluster admin command to generate the submission capability for opam-health-check, it will most likely be something like
    $ ocluster-admin add-client --connect ./capnp-secrets/admin.cap opam-health-check > ~/ocluster.cap`.
    
  3. Add a new worker to the pool you are using.
  4. Run opam-health-serve.
  5. Initialise opam-health-check as described above, add some opam switches and then run the checks.

How to use opam-health-check remotely:

As with local opam-health-check you need to have a server started somewhere and accessible. Don't forget to open the admin and http ports. Default ports are respectively 6666 and 8080. You can change them by modifying the yaml config file at the root of the work directory and restarting the server.

During the first run the server creates an admin user and its key. To connect to the server remotely just you first need to retreive the admin.key file located in <workdir>/keys/admin.key and do opam-health-check init. From there, answer all the questions (hostname, admin-port (default: 6666), username (admin) and the path to the user key you just retreived). You now have your client tool configured with an admin user!

To add new users, just use the opam-health-check add-user <username> command as the admin and give the key to your new user. She now just need to do the same procedure but with her username.

Side note: every user have the same rights and can add new users.

Enjoy.

Troubleshooting

My config.yaml file is getting reset when I edit it!

You should make sure no instance of opam-health-serve is running before editing an instance configuration file.

I started opam-health-serve, ran opam-health-check run, and nothing seems to be happening.

Overall this takes a while. You can run opam-health-check log to follow the progress. Once it's done, you can visit http://localhost:port (where port is set in your config.yaml) to visualize the results.

Can I use opam-health-check to build packages on a custom compiler switch?

Sure, to do that, you need to fork opam-repository, add your compiler switch to it, and point to your forked repository in the extra-repositories field of the config.yaml file. E.g.:

name: default
port: 8080
# [...]
default-repository: ocaml/opam-repository
extra-repositories:
- alpha:
    github: kit-ty-kate/opam-alpha-repository
    for-switches:
    - 5.0+more_volatile
- more-volatile-switch:
    github: OlivierNicole/opam-repository#more_volatile_switch
    for-switches:
    - 5.0+more_volatile
with-test: false
with-lower-bound: false
list-command: opam list --available --installable --short --all-versions
# [...]
ocaml-switches:
- "4.14": 4.14.0
- "5.0": 5.0.0
- "5.0+more_volatile": ocaml-variants.5.0.0+more_volatile
slack-webhooks: []

opam-health-check's People

Contributors

benmandrew avatar hannesm avatar kit-ty-kate avatar misterda avatar mtelvers avatar oliviernicole avatar patricoferris avatar shonfeder avatar tmcgilchrist avatar

Stargazers

 avatar  avatar  avatar  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

opam-health-check's Issues

TODO: Improve the diff page

Reading the last diff is tedious. There are duplicated info, the important changes aren't very well highlighted, …

My current plan is to transform this page into a table similar to the main page:
Untitled
where:

  • the cells that aren't updated will appear empty and white (or another colour to avoid clashes with internal failures)
  • each rows will appear from important change to least important change (the same order as today)
  • each cell that changes will appear with a gradient from before (left) to now (right). background-image: linear-gradient(to right, #64e178 35%, #ff2800 50%);
  • every column available for the two runs will appear (even if they have no diff in them) to keep it consistent

Note: the main /diff page should also be improve by having a table with two column and radio buttons to choose the two run you wanna see a diff of.

Add feedback to inform whether something is happening or not

First of all, thanks for the existence of opam-health-check which is obviously quite a piece of work. I am trying to use opam-health-check and I am being substantially slowed down by the fact that I don’t know whether something is going on, or whether I did something wrong and need to start again.

In detail, I do opam-health-serve --debug --connect <cap_file> <instancedir>, and then opam-health-check run with what I believe to be a proper config file. But hardly any information is printed about what is being set in motion (if anything):

$ opam-health-serve --debug --connect /home/olivier/.config/ocluster/OlivierNicole.cap /home/olivier/opam-health-check/state/instance1
Done. Cache prefetching took: 0. seconds

on the server side, and

$ opam-health-check run                                                                       
Sending command…
$

on the client side.

Since no new logs files are appearing in the instance directory, it’s not clear to me whether something is being computed on the cluster, or nothing happens because of some error / mistake.

Edit.: This would be particularly useful because depending on the cluster’s load, logs might not start appearing before almost an hour.

Detect and filter out deprecated packages

We need some way of tagging packages as "deprecated" so that they don't show up when the "Only show the latest version of each packages" option is enabled.

Would a deprecated flag in the opam file work? e.g.

flags: [deprecated]

All builds based upon Dune 3.12.1 have failed

A typically error logs

(from ocaml/opam:debian-unstable)
Unable to find image 'ocaml/opam:debian-unstable' locally
debian-unstable: Pulling from ocaml/opam
Digest: sha256:5f15ee6802615ad2b650f150e5e945f7e487f56a8943d4ebe039b403409f05da
Status: Downloaded newer image for ocaml/opam:debian-unstable
2023-12-05 20:49.21 ---> using "0acd5aeaa8f7bc314514d9795d14a7f12ec72a6a5b11c5904350189734c6859b" from cache

/: (user (uid 1000) (gid 1000))

/: (env OPAMPRECISETRACKING 1)

/: (env OPAMUTF8 never)

/: (env OPAMEXTERNALSOLVER builtin-0install)

/: (env OPAMCRITERIA +removed)

/: (run (shell "sudo ln -f /usr/bin/opam-dev /usr/bin/opam"))
2023-12-05 20:49.21 ---> using "65c3237f501f7c75f3828458ecf2342bc41c98aaef8c6a7fd82bf46a58cb258c" from cache

/: (run (network host)
        (shell "rm -rf ~/opam-repository && git clone -q 'https://github.com/ocaml/opam-repository' ~/opam-repository && git -C ~/opam-repository checkout -q 9b339ea032fddfa6ce0cb73d84ff1379ebd47ed9"))
2023-12-05 20:49.21 ---> using "20aa2f676c72ba9776270042b43b7edbec546336c3004d1d4a21dacf5f73cd07" from cache

/: (run (shell "rm -rf ~/.opam && opam init -ya --bare --config ~/.opamrc-sandbox ~/opam-repository"))
Configuring from /home/opam/.opamrc-sandbox, then /home/opam/.opamrc, and finally from built-in defaults.
Checking for available remotes: rsync and local, git.
  - you won't be able to use mercurial repositories unless you install the hg command on your system.
  - you won't be able to use darcs repositories unless you install the darcs command on your system.


<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><>
[default] Initialised

User configuration:
  ~/.profile is already up-to-date.
[NOTE] Make sure that ~/.profile is well sourced in your ~/.bashrc.

2023-12-05 20:49.21 ---> using "6b5c385b6a5237a853ba6746a7508f9f8eb9fb9201353e6e33705ec978f3e249" from cache

/: (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
        (network host)
        (shell "opam switch create --repositories=default '4.11' '4.11.2'"))

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
Switch invariant: ["ocaml-base-compiler" {= "4.11.2"} | "ocaml-system" {= "4.11.2"}]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed base-bigarray.base
-> installed base-threads.base
-> installed base-unix.base
-> retrieved ocaml-base-compiler.4.11.2  (https://github.com/ocaml/ocaml/archive/4.11.2.tar.gz)
-> installed ocaml-base-compiler.4.11.2
-> installed ocaml-config.1
-> installed ocaml.4.11.2
Done.
# Run eval $(opam env --switch=4.11) to update the current shell environment
2023-12-05 20:49.21 ---> using "9d9e28702e7b6bbdaee27b231b01db01d97d7fd0fdd44e9b4f0badd24f4a2c71" from cache

/: (run (network host)
        (shell "opam update --depexts"))
+ /usr/bin/sudo "apt-get" "update"
- Get:1 http://deb.debian.org/debian unstable InRelease [198 kB]
- Get:2 http://deb.debian.org/debian unstable/main amd64 Packages.diff/Index [63.6 kB]
- Get:3 http://deb.debian.org/debian unstable/main amd64 Packages T-2023-12-05-1410.42-F-2023-11-30-2009.37.pdiff [339 kB]
- Get:3 http://deb.debian.org/debian unstable/main amd64 Packages T-2023-12-05-1410.42-F-2023-11-30-2009.37.pdiff [339 kB]
- Fetched 601 kB in 1s (421 kB/s)
- Reading package lists...
- 
2023-12-05 20:49.21 ---> using "b3fb6dbc5597caa3a47c34559f1f0c2544deab3a3eb6ab3edd23f234c8aefc8e" from cache

/: (env OCAMLPARAM warn-error=+8,_)

/: (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
        (network host)
        (shell  "\
               \nopam remove -y \"atdj.2.15.0\"\
               \nopam install -vy \"atdj.2.15.0\"\
               \nres=$?\
               \nif [ $res = 31 ]; then\
               \n    if opam show -f x-ci-accept-failures: \"atdj.2.15.0\" | grep -q '\"debian-unstable\"'; then\
               \n        echo \"This package failed and has been disabled for CI using the 'x-ci-accept-failures' field.\"\
               \n        exit 69\
               \n    fi\
               \nfi\
               \n\
               \n\
               \nexit $res\
               \n"))
Nothing to do.
[NOTE] atdj.2.15.0 is not installed.

The following actions will be performed:
=== install 12 packages
  - install atd         2.15.0   [required by atdj]
  - install atdj        2.15.0
  - install cmdliner    1.2.0    [required by atd]
  - install cppo        1.6.9    [required by yojson]
  - install dune        3.12.1   [required by atdj]
  - install easy-format 1.3.4    [required by atd]
  - install menhir      20230608 [required by atd]
  - install menhirLib   20230608 [required by menhir]
  - install menhirSdk   20230608 [required by menhir]
  - install re          1.11.0   [required by atdj]
  - install seq         base     [required by re, yojson]
  - install yojson      2.1.2    [required by atd]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Processing  1/33:
Processing  2/33:
Processing  3/33:
-> retrieved cppo.1.6.9  (cached)
Processing  4/33:
-> retrieved cmdliner.1.2.0  (cached)
Processing  5/33:
Processing  6/33: [cmdliner: make all]
-> retrieved easy-format.1.3.4  (cached)
Processing  7/33: [cmdliner: make all]
-> retrieved menhir.20230608, menhirLib.20230608, menhirSdk.20230608  (cached)
Processing  8/33: [cmdliner: make all]
-> retrieved dune.3.12.1  (cached)
Processing  9/33: [cmdliner: make all]
Processing 10/33: [cmdliner: make all]
Processing 11/33: [cmdliner: make all] [dune: ocaml 255]
Processing 12/33: [cmdliner: make all] [dune: ocaml 255]
-> installed seq.base
Processing 13/33: [cmdliner: make all] [dune: ocaml 255]
-> retrieved atd.2.15.0, atdj.2.15.0  (cached)
+ /home/opam/.opam/opam-init/hooks/sandbox.sh "build" "make" "all" "PREFIX=/home/opam/.opam/4.11" (CWD=/home/opam/.opam/4.11/.opam-switch/build/cmdliner.1.2.0)
- ocaml build.ml cma
- ocaml build.ml cmxa
- ocaml build.ml cmxs
-> compiled  cmdliner.1.2.0
Processing 13/33: [dune: ocaml 255]
Processing 14/33: [dune: ocaml 255] [cmdliner: make install]
-> retrieved re.1.11.0  (cached)
-> retrieved yojson.2.1.2  (cached)
+ /home/opam/.opam/opam-init/hooks/sandbox.sh "install" "make" "install" "LIBDIR=/home/opam/.opam/4.11/lib/cmdliner" "DOCDIR=/home/opam/.opam/4.11/doc/cmdliner" (CWD=/home/opam/.opam/4.11/.opam-switch/build/cmdliner.1.2.0)
- install -d "/home/opam/.opam/4.11/lib/cmdliner"
- install pkg/META _build/cmdliner.mli _build/cmdliner.cmi _build/cmdliner.cmti "/home/opam/.opam/4.11/lib/cmdliner"
- install cmdliner.opam "/home/opam/.opam/4.11/lib/cmdliner/opam"
- install _build/cmdliner.cma "/home/opam/.opam/4.11/lib/cmdliner"
- install _build/cmdliner.cmxa _build/cmdliner.a _build/cmdliner.cmx _build/cmdliner_arg.cmx _build/cmdliner_base.cmx _build/cmdliner_cline.cmx _build/cmdliner_cmd.cmx _build/cmdliner_docgen.cmx _build/cmdliner_eval.cmx _build/cmdliner_exit.cmx _build/cmdliner_info.cmx _build/cmdliner_manpage.cmx _build/cmdliner_msg.cmx _build/cmdliner_term.cmx _build/cmdliner_term_deprecated.cmx _build/cmdliner_trie.cmx \
-   "/home/opam/.opam/4.11/lib/cmdliner"
- install _build/cmdliner.cmxs "/home/opam/.opam/4.11/lib/cmdliner"
Processing 14/33: [dune: ocaml 255] [cmdliner: make install-doc]
+ /home/opam/.opam/opam-init/hooks/sandbox.sh "install" "make" "install-doc" "LIBDIR=/home/opam/.opam/4.11/lib/cmdliner" "DOCDIR=/home/opam/.opam/4.11/doc/cmdliner" (CWD=/home/opam/.opam/4.11/.opam-switch/build/cmdliner.1.2.0)
- install -d "/home/opam/.opam/4.11/doc/cmdliner/odoc-pages"
- install CHANGES.md LICENSE.md README.md "/home/opam/.opam/4.11/doc/cmdliner"
- install doc/index.mld doc/cli.mld doc/examples.mld doc/tutorial.mld \
-            doc/tool_man.mld "/home/opam/.opam/4.11/doc/cmdliner/odoc-pages"
-> installed cmdliner.1.2.0
Processing 14/33: [dune: ocaml 255]
+ /home/opam/.opam/opam-init/hooks/sandbox.sh "build" "ocaml" "boot/bootstrap.ml" "-j" "255" (CWD=/home/opam/.opam/4.11/.opam-switch/build/dune.3.12.1)
- ocamlc -output-complete-exe -w -24 -g -o .duneboot.exe -I boot unix.cma boot/libs.ml boot/duneboot.ml
- ./.duneboot.exe -j 255
- cd _boot && /home/opam/.opam/4.11/bin/ocamlopt.opt -c -g -no-alias-deps -w -49-6 -alert -unstable -I +threads opamLocal.ml
- File "vendor/opam/src/repository/opamLocal.ml", lines 109-114, characters 46-34:
- Error (warning 8): this pattern-matching is not exhaustive.
- Here is an example of a case that is not matched:
- Checksum_mismatch _
- File "vendor/opam/src/repository/opamLocal.ml", lines 170-189, characters 44-56:
- Error (warning 8): this pattern-matching is not exhaustive.
- Here is an example of a case that is not matched:
- Checksum_mismatch _
- File "vendor/opam/src/repository/opamLocal.ml", lines 209-231, characters 8-44:
- Error (warning 8): this pattern-matching is not exhaustive.
- Here is an example of a case that is not matched:
- Checksum_mismatch _
- 

[ERROR] The compilation of dune.3.12.1 failed at "ocaml boot/bootstrap.ml -j 255".

#=== ERROR while compiling dune.3.12.1 ========================================#
# context              2.2.0~alpha4~dev | linux/x86_64 | ocaml-base-compiler.4.11.2 | file:///home/opam/opam-repository
# path                 ~/.opam/4.11/.opam-switch/build/dune.3.12.1
# command              ~/.opam/opam-init/hooks/sandbox.sh build ocaml boot/bootstrap.ml -j 255
# exit-code            2
# env-file             ~/.opam/log/dune-8-722d42.env
# output-file          ~/.opam/log/dune-8-722d42.out
### output ###
# ocamlc -output-complete-exe -w -24 -g -o .duneboot.exe -I boot unix.cma boot/libs.ml boot/duneboot.ml
# ./.duneboot.exe -j 255
# cd _boot && /home/opam/.opam/4.11/bin/ocamlopt.opt -c -g -no-alias-deps -w -49-6 -alert -unstable -I +threads opamLocal.ml
# File "vendor/opam/src/repository/opamLocal.ml", lines 109-114, characters 46-34:
# Error (warning 8): this pattern-matching is not exhaustive.
# Here is an example of a case that is not matched:
# Checksum_mismatch _
# File "vendor/opam/src/repository/opamLocal.ml", lines 170-189, characters 44-56:
# Error (warning 8): this pattern-matching is not exhaustive.
# Here is an example of a case that is not matched:
# Checksum_mismatch _
# File "vendor/opam/src/repository/opamLocal.ml", lines 209-231, characters 8-44:
# Error (warning 8): this pattern-matching is not exhaustive.
# Here is an example of a case that is not matched:
# Checksum_mismatch _
# 




<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions were aborted
| - install atd         2.15.0
| - install atdj        2.15.0
| - install cppo        1.6.9
| - install easy-format 1.3.4
| - install menhir      20230608
| - install menhirLib   20230608
| - install menhirSdk   20230608
| - install re          1.11.0
| - install yojson      2.1.2
+- 
+- The following actions failed
| - build dune 3.12.1
+- 
+- The following changes have been performed (the rest was aborted)
| - install cmdliner 1.2.0
| - install seq      base
+- 

The former state can be restored with:
    /usr/bin/opam switch import "/home/opam/.opam/4.11/.opam-switch/backup/state-20231205204923.export"
'opam install -vy atdj.2.15.0' failed.
# Run eval $(opam env) to update the current shell environment
"/usr/bin/env" "bash" "-c" "
opam remove -y "atdj.2.15.0"
opam install -vy "atdj.2.15.0"
res=$?
if [ $res = 31 ]; then
    if opam show -f x-ci-accept-failures: "atdj.2.15.0" | grep -q '"debian-unstable"'; then
        echo "This package failed and has been disabled for CI using the 'x-ci-accept-failures' field."
        exit 69
    fi
fi


exit $res
" failed with exit status 31
Failed: Build failed

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.