jolt 0.9.355__py3-none-any.whl → 0.9.370__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jolt/__init__.py +47 -0
- jolt/cache.py +339 -159
- jolt/cli.py +29 -98
- jolt/config.py +14 -26
- jolt/graph.py +27 -15
- jolt/loader.py +141 -180
- jolt/manifest.py +0 -46
- jolt/options.py +35 -12
- jolt/plugins/conan.py +238 -0
- jolt/plugins/docker.py +1 -1
- jolt/plugins/environ.py +11 -0
- jolt/plugins/gdb.py +6 -5
- jolt/plugins/linux.py +943 -0
- jolt/plugins/ninja-compdb.py +7 -6
- jolt/plugins/podman.py +4 -4
- jolt/plugins/scheduler.py +18 -14
- jolt/plugins/selfdeploy/setup.py +1 -1
- jolt/plugins/selfdeploy.py +1 -22
- jolt/plugins/strings.py +16 -6
- jolt/scheduler.py +428 -138
- jolt/tasks.py +23 -0
- jolt/tools.py +15 -8
- jolt/version.py +1 -1
- {jolt-0.9.355.dist-info → jolt-0.9.370.dist-info}/METADATA +2 -2
- {jolt-0.9.355.dist-info → jolt-0.9.370.dist-info}/RECORD +28 -29
- jolt/plugins/debian.py +0 -338
- jolt/plugins/repo.py +0 -253
- {jolt-0.9.355.dist-info → jolt-0.9.370.dist-info}/WHEEL +0 -0
- {jolt-0.9.355.dist-info → jolt-0.9.370.dist-info}/entry_points.txt +0 -0
- {jolt-0.9.355.dist-info → jolt-0.9.370.dist-info}/top_level.txt +0 -0
jolt/plugins/ninja-compdb.py
CHANGED
|
@@ -115,7 +115,7 @@ def get_task_artifacts(task):
|
|
|
115
115
|
|
|
116
116
|
class CompDBHooks(TaskHook):
|
|
117
117
|
def __init__(self):
|
|
118
|
-
self._depfiles = config.getboolean("ninja-compdb", "depfiles",
|
|
118
|
+
self._depfiles = config.getboolean("ninja-compdb", "depfiles", False)
|
|
119
119
|
|
|
120
120
|
def publish_compdb(self, artifact, tools):
|
|
121
121
|
with tools.cwd(self.outdir):
|
|
@@ -226,19 +226,18 @@ def compdb(ctx, task, default):
|
|
|
226
226
|
|
|
227
227
|
"""
|
|
228
228
|
|
|
229
|
-
manifest = ctx.obj["manifest"]
|
|
230
229
|
options = JoltOptions(default=default)
|
|
231
230
|
acache = cache.ArtifactCache.get(options)
|
|
232
231
|
TaskHookRegistry.get(options)
|
|
233
232
|
executors = scheduler.ExecutorRegistry.get(options)
|
|
234
233
|
registry = TaskRegistry.get()
|
|
235
234
|
strategy = scheduler.DownloadStrategy(executors, acache)
|
|
236
|
-
queue = scheduler.TaskQueue(
|
|
235
|
+
queue = scheduler.TaskQueue()
|
|
237
236
|
|
|
238
237
|
for params in default:
|
|
239
238
|
registry.set_default_parameters(params)
|
|
240
239
|
|
|
241
|
-
gb = graph.GraphBuilder(registry, acache,
|
|
240
|
+
gb = graph.GraphBuilder(registry, acache, options, progress=True)
|
|
242
241
|
dag = gb.build(task)
|
|
243
242
|
|
|
244
243
|
try:
|
|
@@ -251,9 +250,10 @@ def compdb(ctx, task, default):
|
|
|
251
250
|
|
|
252
251
|
while leafs:
|
|
253
252
|
task = leafs.pop()
|
|
254
|
-
|
|
253
|
+
executor = strategy.create_executor({}, task)
|
|
254
|
+
queue.submit(executor)
|
|
255
255
|
|
|
256
|
-
task,
|
|
256
|
+
task, _ = queue.wait()
|
|
257
257
|
|
|
258
258
|
# Materialize workspace resources so that
|
|
259
259
|
# source code is available to the debugger.
|
|
@@ -272,6 +272,7 @@ def compdb(ctx, task, default):
|
|
|
272
272
|
log.warning("Interrupted by user")
|
|
273
273
|
try:
|
|
274
274
|
queue.abort()
|
|
275
|
+
executors.shutdown()
|
|
275
276
|
sys.exit(1)
|
|
276
277
|
except KeyboardInterrupt:
|
|
277
278
|
print()
|
jolt/plugins/podman.py
CHANGED
|
@@ -206,8 +206,8 @@ class Container(Resource):
|
|
|
206
206
|
"""
|
|
207
207
|
|
|
208
208
|
volumes_default = [
|
|
209
|
-
"{joltdir}
|
|
210
|
-
"{joltcachedir}
|
|
209
|
+
"{joltdir}",
|
|
210
|
+
"{joltcachedir}",
|
|
211
211
|
]
|
|
212
212
|
"""
|
|
213
213
|
A list of default volumes to mount.
|
|
@@ -247,7 +247,7 @@ class Container(Resource):
|
|
|
247
247
|
def _image(self):
|
|
248
248
|
registry = TaskRegistry.get()
|
|
249
249
|
tool = tools.Tools(self)
|
|
250
|
-
if registry.
|
|
250
|
+
if registry.get_task(tool.expand(self.image)):
|
|
251
251
|
return [self.image]
|
|
252
252
|
return []
|
|
253
253
|
|
|
@@ -284,7 +284,7 @@ class Container(Resource):
|
|
|
284
284
|
|
|
285
285
|
@property
|
|
286
286
|
def _volumes(self):
|
|
287
|
-
return " ".join([utils.option("-v ", self.tools.
|
|
287
|
+
return " ".join([utils.option("-v ", self.tools.expand_path(vol))
|
|
288
288
|
for vol in self.volumes_default + self.volumes])
|
|
289
289
|
|
|
290
290
|
def acquire(self, artifact, deps, tools, owner):
|
jolt/plugins/scheduler.py
CHANGED
|
@@ -13,7 +13,6 @@ from jolt import config
|
|
|
13
13
|
from jolt import hooks
|
|
14
14
|
from jolt import loader
|
|
15
15
|
from jolt import log
|
|
16
|
-
from jolt import manifest
|
|
17
16
|
from jolt import common_pb2 as common_pb
|
|
18
17
|
from jolt import scheduler
|
|
19
18
|
from jolt import utils
|
|
@@ -145,6 +144,15 @@ class RemoteExecutor(NetworkExecutor):
|
|
|
145
144
|
self.session = session
|
|
146
145
|
self.task = task
|
|
147
146
|
|
|
147
|
+
def schedule(self, env):
|
|
148
|
+
"""
|
|
149
|
+
Schedule the task for execution.
|
|
150
|
+
|
|
151
|
+
The task is marked as in progress before scheduling.
|
|
152
|
+
"""
|
|
153
|
+
self.task.set_in_progress()
|
|
154
|
+
return super().schedule(env)
|
|
155
|
+
|
|
148
156
|
def cancel(self):
|
|
149
157
|
"""
|
|
150
158
|
Cancel the build session.
|
|
@@ -436,21 +444,11 @@ class RemoteSession(object):
|
|
|
436
444
|
if self.build:
|
|
437
445
|
return
|
|
438
446
|
|
|
439
|
-
registry = ExecutorRegistry.get()
|
|
440
|
-
|
|
441
447
|
if not self.buildenv:
|
|
442
|
-
# Create a list of parameters to send to the scheduler.
|
|
443
|
-
parameters = []
|
|
444
|
-
for key, value in registry.get_network_parameters(None).items():
|
|
445
|
-
parameters.append(common_pb.Property(key=key, value=value))
|
|
446
|
-
|
|
447
|
-
# Add parameters from the config / command line (-c params.key).
|
|
448
|
-
parameters.extend(config.export_params())
|
|
449
|
-
|
|
450
448
|
# Create the build environment.
|
|
451
449
|
self.buildenv = common_pb.BuildEnvironment(
|
|
452
450
|
client=selfdeploy.get_client(),
|
|
453
|
-
parameters=
|
|
451
|
+
parameters=config.export_params(),
|
|
454
452
|
task_default_parameters=scheduler.export_task_default_params(self.tasks),
|
|
455
453
|
tasks=scheduler.export_tasks(self.tasks + self.pruned),
|
|
456
454
|
workspace=loader.export_workspace(self.tasks),
|
|
@@ -580,8 +578,14 @@ def executor(ctx, worker, build, request):
|
|
|
580
578
|
loglevel = request.environment.loglevel
|
|
581
579
|
log.set_level_pb(loglevel)
|
|
582
580
|
|
|
583
|
-
# Import
|
|
584
|
-
|
|
581
|
+
# Import workspace
|
|
582
|
+
loader.import_workspace(request.environment)
|
|
583
|
+
|
|
584
|
+
# Import configuration snippet
|
|
585
|
+
config.import_config(request.environment.config)
|
|
586
|
+
|
|
587
|
+
# Import configuration parameters (-c params.key)
|
|
588
|
+
config.import_params({param.key: param.value for param in request.environment.parameters})
|
|
585
589
|
|
|
586
590
|
options = JoltOptions(
|
|
587
591
|
network=True,
|
jolt/plugins/selfdeploy/setup.py
CHANGED
jolt/plugins/selfdeploy.py
CHANGED
|
@@ -12,12 +12,9 @@ from jolt.cache import ArtifactCache
|
|
|
12
12
|
from jolt.error import raise_error_if
|
|
13
13
|
from jolt.graph import GraphBuilder
|
|
14
14
|
from jolt.loader import JoltLoader
|
|
15
|
-
from jolt.manifest import JoltManifest
|
|
16
15
|
from jolt.scheduler import JoltEnvironment
|
|
17
16
|
from jolt.scheduler import LocalExecutor
|
|
18
17
|
from jolt.scheduler import LocalExecutorFactory
|
|
19
|
-
from jolt.scheduler import NetworkExecutorExtension
|
|
20
|
-
from jolt.scheduler import NetworkExecutorExtensionFactory
|
|
21
18
|
from jolt.tasks import Task, TaskRegistry
|
|
22
19
|
|
|
23
20
|
|
|
@@ -99,24 +96,6 @@ class Jolt(Task):
|
|
|
99
96
|
artifact.collect(fs.path.basename(e))
|
|
100
97
|
|
|
101
98
|
|
|
102
|
-
class SelfDeployExtension(NetworkExecutorExtension):
|
|
103
|
-
@utils.cached.instance
|
|
104
|
-
def get_parameters(self, _):
|
|
105
|
-
client = get_client()
|
|
106
|
-
params = {}
|
|
107
|
-
if client.identity:
|
|
108
|
-
params["jolt_identity"] = client.identity
|
|
109
|
-
if client.url:
|
|
110
|
-
params["jolt_url"] = client.url
|
|
111
|
-
return params
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
@NetworkExecutorExtensionFactory.Register
|
|
115
|
-
class SelfDeployExtensionFactory(NetworkExecutorExtensionFactory):
|
|
116
|
-
def create(self):
|
|
117
|
-
return SelfDeployExtension()
|
|
118
|
-
|
|
119
|
-
|
|
120
99
|
@utils.cached.method
|
|
121
100
|
def get_dependencies(packages=None):
|
|
122
101
|
reqs = packages or ["jolt"]
|
|
@@ -157,7 +136,7 @@ def publish_artifact():
|
|
|
157
136
|
registry.add_task_class(Jolt)
|
|
158
137
|
acache = ArtifactCache.get()
|
|
159
138
|
env = JoltEnvironment(cache=acache, queue=None)
|
|
160
|
-
gb = GraphBuilder(registry, acache
|
|
139
|
+
gb = GraphBuilder(registry, acache)
|
|
161
140
|
dag = gb.build(["jolt"])
|
|
162
141
|
task = dag.select(lambda graph, task: True)
|
|
163
142
|
assert len(task) == 1, "Too many selfdeploy tasks found"
|
jolt/plugins/strings.py
CHANGED
|
@@ -2,6 +2,18 @@ from jolt.cache import ArtifactAttributeSetProvider
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class StringVariableSet(object):
|
|
5
|
+
"""
|
|
6
|
+
A set of string variables for an artifact.
|
|
7
|
+
|
|
8
|
+
Example:
|
|
9
|
+
|
|
10
|
+
.. code-block:: python
|
|
11
|
+
|
|
12
|
+
artifact.strings.foo = "bar"
|
|
13
|
+
print(artifact.strings.foo)
|
|
14
|
+
|
|
15
|
+
"""
|
|
16
|
+
|
|
5
17
|
def __init__(self, artifact):
|
|
6
18
|
super(StringVariableSet, self).__setattr__("_attributes", {})
|
|
7
19
|
super(StringVariableSet, self).__setattr__("_artifact", artifact)
|
|
@@ -29,6 +41,10 @@ class StringVariableSet(object):
|
|
|
29
41
|
|
|
30
42
|
@ArtifactAttributeSetProvider.Register
|
|
31
43
|
class StringVariableSetProvider(ArtifactAttributeSetProvider):
|
|
44
|
+
"""
|
|
45
|
+
A provider of string variable sets.
|
|
46
|
+
"""
|
|
47
|
+
|
|
32
48
|
def create(self, artifact):
|
|
33
49
|
setattr(artifact, "strings", StringVariableSet(artifact))
|
|
34
50
|
|
|
@@ -45,9 +61,3 @@ class StringVariableSetProvider(ArtifactAttributeSetProvider):
|
|
|
45
61
|
|
|
46
62
|
for key, value in artifact.strings.items():
|
|
47
63
|
content["strings"][key] = str(value)
|
|
48
|
-
|
|
49
|
-
def apply(self, task, artifact):
|
|
50
|
-
pass
|
|
51
|
-
|
|
52
|
-
def unapply(self, task, artifact):
|
|
53
|
-
pass
|