Closed Bug 1117214 Opened 10 years ago Closed 7 years ago

implement 'stop', and 'start' endpoints for aws instances in slaveapi

Categories

(Release Engineering :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: jlund, Assigned: jlund)

References

Details

Attachments

(2 files)

No description provided.
success cases: > curl slaveapi-dev1.srv.releng.scl3.mozilla.com:8086/slaves/dev-linux64-ec2-jlund2/actions/stop { "aws_stop_instance": { "29813904": { "finish_timestamp": 1420243041.225596, "request_timestamp": 1420243006.403485, "start_timestamp": 1420243006.405307, "state": 2, "text": "Instance 'dev-linux64-ec2-jlund2' stopping" } } }% > curl slaveapi-dev1.srv.releng.scl3.mozilla.com:8086/slaves/dev-linux64-ec2-jlund2/actions/start { "aws_start_instance": { "29814032": { "finish_timestamp": 1420243216.792774, "request_timestamp": 1420243185.879034, "start_timestamp": 1420243185.88024, "state": 2, "text": "Instance 'dev-linux64-ec2-jlund2' starting" } } }% > curl slaveapi-dev1.srv.releng.scl3.mozilla.com:8086/slaves/dev-linux64-ec2-jlund2/actions/status { "29836304": { "finish_timestamp": 1420243260.200424, "request_timestamp": 1420243244.723631, "start_timestamp": 1420243244.724331, "state": 2, "text": "Instance 'dev-linux64-ec2-jlund2': {'Name': 'dev-linux64-ec2-jlund2', 'created': '2015-01-0223:40:31PST', 'moz-type': 'dev-linux64', 'FQDN': 'dev-linux64-ec2-jlund2.dev.releng.use1.mozilla.com', 'moz-state': 'ready', 'moz-bug': '858797', 'moz-loaned-to': 'jlund@mozilla.com'}" } } }% not found (same for all endpoints): jlund@Hastings163:~BUDM (*) (!) > curl slaveapi-dev1.srv.releng.scl3.mozilla.com:8086/slaves/dev-linux64-ec2-jlund3/actions/start clone-less [c0a07e6] (!) untracked { "aws_start_instance": { "29836752": { "finish_timestamp": 1420243552.924432, "request_timestamp": 1420243537.449356, "start_timestamp": 1420243537.450779, "state": 3, "text": "Instance 'dev-linux64-ec2-jlund3' could not be found. Does it exist?" } } }%
Attachment #8543443 - Flags: review?(coop)
Assignee: nobody → jlund
Comment on attachment 8543443 [details] [diff] [review] 150102_1117214_aws_start_stop_status-slaveapi.patch Review of attachment 8543443 [details] [diff] [review]: ----------------------------------------------------------------- r- for adding the new actions/status endpoint. If we can roll that into the basic output for a slave, we're good. ::: slaveapi/clients/aws.py @@ +58,2 @@ > # we rely on logging module output to determine if instance has been terminated > + terminated = re.search(success_regex, logging_output) Do we really need to parse the output to determine success here? Ugh. ::: slaveapi/web/__init__.py @@ +18,5 @@ > app.add_url_rule("/slaves/<slave>/actions/disable", view_func=Disable.as_view("disable"), methods=["GET", "POST"]) > app.add_url_rule("/slaves/<slave>/actions/terminate", view_func=AWSTerminateInstance.as_view("aws_terminate_instance"), methods=["GET", "POST"]) > +app.add_url_rule("/slaves/<slave>/actions/start", view_func=AWSStartInstance.as_view("aws_start_instance"), methods=["GET", "POST"]) > +app.add_url_rule("/slaves/<slave>/actions/stop", view_func=AWSStopInstance.as_view("aws_stop_instance"), methods=["GET", "POST"]) > +app.add_url_rule("/slaves/<slave>/actions/status", view_func=AWSInstanceStatus.as_view("aws_instance_type"), methods=["GET", "POST"]) I was speaking to Callek last week, and he raised the point that we shouldn't need to call a separate, AWS-specific method to get the basic information for an AWS node. If I visit a link like, e.g. https://secure.pub.build.mozilla.org/slaveapi/slaves/tst-linux64-spot-152 ...it should be smart enough to look up the status from wherever it needs to by default.
Attachment #8543443 - Flags: review?(coop) → review-
Summary: implement 'status', 'stop', and 'start' endpoints for aws instances in slaveapi → implement 'stop', and 'start' endpoints for aws instances in slaveapi
filed "Bug 1123484 - add aws status details to slaveapi slave info if slave is an ec2 instance" for tracking the 'status' work that was originally an endpoint in this bug.
interdiff from last patch: http://people.mozilla.org/~jlund/150119_aws_start_stop_slaveapi_endpoints-interdiff.patch note: I kept instance_status() in clienst/aws.py as I think it may be used in conjunction with other endpoint calls later down the line.
Attachment #8551523 - Flags: review?(coop)
Attachment #8551523 - Flags: review?(coop) → review+
Comment on attachment 8551523 [details] [diff] [review] 150119_aws_start_stop_slaveapi_endpoints.patch checked in and running on dev node: http://git.mozilla.org/?p=build/slaveapi.git;a=commit;h=2dcb818f172f8d0303eee635629d52c61841885e prod node hasn't had its slaveapi version bumped yet
Attachment #8551523 - Flags: checked-in+
Component: Tools → General
Not expecting to work on this tool anymore.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: