Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: appengine/swarming/swarming_rpcs.py

Issue 1946253003: swarming: refactor cipd input (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@default-isolate-server
Patch Set: fix import google.protobuf Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2015 The LUCI Authors. All rights reserved. 1 # Copyright 2015 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed by the Apache v2.0 license that can be 2 # Use of this source code is governed by the Apache v2.0 license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """This module defines ProtoRPC types for the Swarming Server handlers.""" 5 """This module defines ProtoRPC types for the Swarming Server handlers."""
6 6
7 from protorpc import message_types 7 from protorpc import message_types
8 from protorpc import messages 8 from protorpc import messages
9 9
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 # The hash of an isolated archive. 77 # The hash of an isolated archive.
78 isolated = messages.StringField(1) 78 isolated = messages.StringField(1)
79 # The hostname of the isolated server to use. 79 # The hostname of the isolated server to use.
80 isolatedserver = messages.StringField(2) 80 isolatedserver = messages.StringField(2)
81 # Namespace on the isolate server. 81 # Namespace on the isolate server.
82 namespace = messages.StringField(3) 82 namespace = messages.StringField(3)
83 83
84 84
85 class CipdPackage(messages.Message): 85 class CipdPackage(messages.Message):
86 """A CIPD package to install in $CIPD_PATH and $PATH before task execution.""" 86 """A CIPD package to install in $CIPD_PATH and $PATH before task execution."""
87 # Full CIPD package name, e.g. "infra/tools/authutil/linux-amd64" 87 # A template of a full CIPD package name, e.g.
88 # "infra/tools/authutil/${platform}"
89 # See also cipd.ALL_PARAMS.
88 package_name = messages.StringField(1) 90 package_name = messages.StringField(1)
89 # Instance ID, tag or ref, e.g. "latest". 91 # Valid package version for all packages matched by package name.
90 version = messages.StringField(2) 92 version = messages.StringField(2)
91 93
92 94
95 class CipdInput(messages.Message):
96 """Defines CIPD packages to install in $CIPD_PATH.
97
98 A command may use $CIPD_PATH in its arguments. It will be expanded to the path
99 of the CIPD site root.
100 """
101 # Serialized config_pb2.CipdSettings message. When creating a new task
102 # this field can override cipd settings defined on the server,
103 # for testing purposes.
104 # This field is optional if default settings are configured on the server.
105 settings = messages.BytesField(1)
M-A Ruel 2016/05/11 14:56:45 why not expand it? I'd prefer that to encoded prot
nodir 2016/05/12 01:53:22 Done. This lead to rethinking of how I embed cipd
106 # List of CIPD packages to install in $CIPD_PATH prior task execution.
107 packages = messages.MessageField(CipdPackage, 2, repeated=True)
108
109
93 class TaskProperties(messages.Message): 110 class TaskProperties(messages.Message):
94 """Important metadata about a particular task.""" 111 """Important metadata about a particular task."""
112 cipd_input = messages.MessageField(CipdInput, 10)
95 command = messages.StringField(1, repeated=True) 113 command = messages.StringField(1, repeated=True)
96 dimensions = messages.MessageField(StringPair, 2, repeated=True) 114 dimensions = messages.MessageField(StringPair, 2, repeated=True)
97 env = messages.MessageField(StringPair, 3, repeated=True) 115 env = messages.MessageField(StringPair, 3, repeated=True)
98 execution_timeout_secs = messages.IntegerField(4) 116 execution_timeout_secs = messages.IntegerField(4)
99 extra_args = messages.StringField(5, repeated=True) 117 extra_args = messages.StringField(5, repeated=True)
100 grace_period_secs = messages.IntegerField(6) 118 grace_period_secs = messages.IntegerField(6)
101 idempotent = messages.BooleanField(7) 119 idempotent = messages.BooleanField(7)
102 inputs_ref = messages.MessageField(FilesRef, 8) 120 inputs_ref = messages.MessageField(FilesRef, 8)
103 io_timeout_secs = messages.IntegerField(9) 121 io_timeout_secs = messages.IntegerField(9)
104 packages = messages.MessageField(CipdPackage, 10, repeated=True)
105 122
106 123
107 class NewTaskRequest(messages.Message): 124 class NewTaskRequest(messages.Message):
108 """Description of a new task request as described by the client.""" 125 """Description of a new task request as described by the client."""
109 expiration_secs = messages.IntegerField(1) 126 expiration_secs = messages.IntegerField(1)
110 name = messages.StringField(2) 127 name = messages.StringField(2)
111 parent_task_id = messages.StringField(3) 128 parent_task_id = messages.StringField(3)
112 priority = messages.IntegerField(4) 129 priority = messages.IntegerField(4)
113 properties = messages.MessageField(TaskProperties, 5) 130 properties = messages.MessageField(TaskProperties, 5)
114 tags = messages.StringField(6, repeated=True) 131 tags = messages.StringField(6, repeated=True)
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 396
380 397
381 class DeletedResponse(messages.Message): 398 class DeletedResponse(messages.Message):
382 """Indicates whether a bot was deleted.""" 399 """Indicates whether a bot was deleted."""
383 deleted = messages.BooleanField(1) 400 deleted = messages.BooleanField(1)
384 401
385 402
386 class TerminateResponse(messages.Message): 403 class TerminateResponse(messages.Message):
387 """Returns the pseudo taskid to wait for the bot to shut down.""" 404 """Returns the pseudo taskid to wait for the bot to shut down."""
388 task_id = messages.StringField(1) 405 task_id = messages.StringField(1)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698