-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add COS integration to Openstack #266
Add COS integration to Openstack #266
Conversation
…gration' into ISD-1824-cos-integration-openstack # Conflicts: # src/openstack_cloud/openstack_manager.py # templates/openstack-userdata.sh.j2
try: | ||
self._pull_file( | ||
ssh_conn=ssh_conn, | ||
remote_path=str(METRICS_EXCHANGE_PATH / "pre-job-metrics.json"), | ||
local_path=str(storage.path / "pre-job-metrics.json"), | ||
max_size=MAX_METRICS_FILE_SIZE, | ||
) | ||
self._pull_file( | ||
ssh_conn=ssh_conn, | ||
remote_path=str(METRICS_EXCHANGE_PATH / "post-job-metrics.json"), | ||
local_path=str(storage.path / "post-job-metrics.json"), | ||
max_size=MAX_METRICS_FILE_SIZE, | ||
) | ||
return | ||
except _PullFileError as exc: | ||
logger.warning( | ||
"Failed to pull metrics for %s: %s . Will not be able to issue all metrics", | ||
instance_name, | ||
exc, | ||
) | ||
return | ||
except _SSHError as exc: | ||
logger.info("Failed to pull metrics for %s: %s", instance_name, exc) | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The downside here is that if only the pre-job-metrics.json
is pulled, the runner is considered crashed (see logic in _issue_reconciliation_metric
), we may want to revisit this. But for now I kept it the same as for LXD.
…gration' into ISD-1824-cos-integration-openstack # Conflicts: # src/charm.py # src/openstack_cloud/openstack_manager.py # templates/openstack-userdata.sh.j2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed till _issue_runner_installed_metric
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Minor nitpicks - no need to implement :D
Applicable spec: ISD-145 (internal)
Overview
Add cos integration to the openstack branch. The Openstack code is going to be refactored (see ISD 134), so there are parts that contain code duplication and should be addressed in a follow-on.
Integration tests are not included in this PR and will be added in a future PR.
The log retrieval code will be adapted in a future PR to retrieve logs periodically (also for LXD) and is not included here.
Rationale
This is necessary for observability.
Juju Events Changes
n/a
Module Changes
metrics
package.shared_fs
implements it. This is done to reuse therunner
metrics module (see also ISD-145).OpenStackRunnerManager
is adapted to output runner related metrics.runner_logs
is split into general and lxd related codeopenstack-userdata.j2
) is adapted to write out metrics and pre-job content. system shutdown is removed to be able to retrieve metrics (otherwise the instance would have to be restarted).Library Changes
Checklist
src-docs
urgent
,trivial
,complex
)The Openstack documentation will be added as soon as we have a MVP landed.