Giter Site home page Giter Site logo

Comments (5)

talex5 avatar talex5 commented on July 18, 2024

This means you're trying to create two resource pools with the same name. Since pools should only be created at startup, and this is being reported as a test result, you're probably trying to create a new pool for each test.

The pools are memory-only, so restarting will clear the state.

Make sure that your my_tests function doesn't create any pools (and doesn't call any function that takes a ~logs argument - it's possible that one of them creates a pool internaly).

from datakit.

Thegaram avatar Thegaram commented on July 18, 2024

Oh okay, I accidentally still had some new pools apparently. Looking out for ~logs helped, thanks!

from datakit.

Thegaram avatar Thegaram commented on July 18, 2024

I was wrong, it still doesn't work. I have the following code (which, in many ways, is analogous to the one in self-ci):

module Tests = struct
  open Term.Infix

  let repos =
    object(_self)
      method main_repo = Git.v ~logs ~remote:"/mnt/myproject_remote" "/data/repos/myproject"
    end

  let images src =
    let timeout = (30. *. minute) in
    let tests_dockerfile = Docker.create ~logs ~pool ~timeout ~label:"tests_docker" "Dockerfile" in
    object(_self)
      method tests = src >>= Docker.build ?from:None tests_dockerfile
    end

  let commands =
    let timeout = (30. *. minute) in
    object(_self)
      method run_tests = Docker.command ~logs ~pool ~timeout ~label:"tests" ~network:"host" []
    end

  let check_run term =
    term >|= fun _ -> "Run succeeded"

  let tests target =
    let src = Git.fetch_head repos#main_repo target in
    let images = images src in

    [
      "build_and_run_tests", check_run (images#tests >>= Docker.run commands#run_tests);
    ]

end

let projects = [
  Config.project ~id:"me/myproject" (Tests.tests)
]

At first it runs fine, but if I restart the CI I get "Assert_failure ci/src/cI_monitored_pool.ml:44:2". I might be missing some trivial point, I am fairly new to OCaml.

from datakit.

talex5 avatar talex5 commented on July 18, 2024

commands#run_tests is a method call. It will create a new cache every time you run it. You probably want something like:

  module Commands = struct
    let timeout = 30. *. minute
    let run_tests = Docker.command ~logs ~pool ~timeout ~label:"tests" ~network:"host" []
  end

from datakit.

Thegaram avatar Thegaram commented on July 18, 2024

Worked, thanks!

from datakit.

Related Issues (20)

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.