Skip to content

Commit

Permalink
Create ContainerStoppedMetadata class (facebookresearch#521)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebookresearch#521

Added `ContainerStoppedMetadata` class in order to provide more insights to improve the debugging efficiency.

For this task, we mainly focus on the metadata when a container stopped (normally or unexpectedly). `ContainerStoppedMetadata` will be an attribute of `ContainerInstance`.

Reviewed By: ziqih, zhuang-93

Differential Revision: D44940312

fbshipit-source-id: 092bb315f2775b2f96e92a58eddeaf8a570dae44
  • Loading branch information
Michael Meng authored and facebook-github-bot committed Apr 18, 2023
1 parent 382b6eb commit dba3a06
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- Integrate InsightsService with OneDockerService
- Add ContainerStoppedMetadata
### Changed
### Removed

Expand Down
2 changes: 2 additions & 0 deletions fbpcp/entity/container_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from typing import Optional

from dataclasses_json import dataclass_json
from fbpcp.entity.container_metadata import ContainerStoppedMetadata
from fbpcp.entity.container_permission import ContainerPermissionConfig


Expand All @@ -31,3 +32,4 @@ class ContainerInstance:
memory: Optional[int] = None # Memory in GB
exit_code: Optional[int] = None
permission: Optional[ContainerPermissionConfig] = None
stopped_metadata: Optional[ContainerStoppedMetadata] = None
16 changes: 16 additions & 0 deletions fbpcp/entity/container_metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# pyre-strict

from dataclasses import dataclass


@dataclass
class ContainerStoppedMetadata:
stopped_at: str
stop_code: str
stopped_reason: str

0 comments on commit dba3a06

Please sign in to comment.