-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Topological sort info by tiers #86
Comments
Could you describe how you'd use that to parallelize the projects in CircleCI? At a guess, you want to run the logically-independent projects in separate containers, but it seems like the overhead of managing all of the caches between those runs would dominate the time to actually build or test the projects. What we do at Amperity is to have one job that does a parallelized install (using the (defn mod-selector
"Given a pair of environment variable names, parse them to determine the
current and total nodes to distribute the projects over. Returns a function
suitable for use as a `:project-selector`. Throws an exception if the
variables are not present in the environment."
[base index-var total-var]
(let [index (System/getenv index-var)
total (System/getenv total-var)]
(if (and index total)
;; Distribute projects across nodes.
(let [i (Integer/parseInt index)
n (Integer/parseInt total)]
(fn selected?
[project]
(= (- i base) (rem (:monolith/index project) n))))
;; Missing vars, print warning and accept everything.
(do
(binding [*out* *err*]
(println "WARN: Cannot select projects without environment vars"
index-var "and" total-var))
(constantly true))))) :monolith
{:project-selectors
{,,,
;; This selector picks a subset of projects which modulo to the current
;; container index in CircleCI.
:circle-ci
(do (load-file "util/test/selectors.clj")
(amperity.monolith.selectors/mod-selector
0 "CIRCLE_NODE_INDEX" "CIRCLE_NODE_TOTAL"))}} |
i am thinking about something like described here: so for every project in monorepo i would have a boolean parameter, which can be changed by checking what is changed by monolith plugin and the parallelise it. So maximum parallelism that i can achieve here is maximum count of independent project on a given level of dependency tree |
Hello and thank you for your work :)
Question:
I want to be able to query tiers of topology, e.g if we have this graph of dependencies:
projects A and B are libs and C depends on A and B i would like to receive a structure of sort:
[[A, B],[C]]
i.e. in every item vector the code is independent
I need this information in order to make it work with parallel api in CircleCI
The text was updated successfully, but these errors were encountered: