-
Notifications
You must be signed in to change notification settings - Fork 27
added GPU environment support #11
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
634357f
5ce3bf5
c0b3c15
35540a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,17 @@ | |
|
||
|
||
class TempCodeBuildProject: | ||
def __init__(self, s3_location, role, repository=None, compute_type=None): | ||
def __init__(self, s3_location, role, repository=None, compute_type=None, environment=None): | ||
self.s3_location = s3_location | ||
self.role = role | ||
|
||
self.session = boto3.session.Session() | ||
self.domain_id, self.user_profile_name = self._get_studio_metadata() | ||
self.repo_name = None | ||
self.compute_type = compute_type or "BUILD_GENERAL1_SMALL" | ||
self.environment = environment or "LINUX_CONTAINER" | ||
if self.environment=="LINUX_GPU_CONTAINER" and self.compute_type=="BUILD_GENERAL1_SMALL": | ||
self.compute_type="BUILD_GENERAL1_LARGE" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: Why is this required? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BUILD_GENERAL1_LARGE will automatically switch to a GPU instance if LINUX_GPU_CONTAINER is set. Small or medium will not. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. In that case, I recommend we make this explicit - Fail if the user is requested GPU and Small or Medium, because these are incompatible configuration options |
||
|
||
if repository: | ||
self.repo_name, self.tag = repository.split(":", maxsplit=1) | ||
|
@@ -61,7 +64,7 @@ def __enter__(self): | |
"source": {"type": "S3", "location": self.s3_location}, | ||
"artifacts": {"type": "NO_ARTIFACTS"}, | ||
"environment": { | ||
"type": "LINUX_CONTAINER", | ||
"type": self.environment, | ||
"image": "aws/codebuild/standard:4.0", | ||
"computeType": self.compute_type, | ||
"environmentVariables": [ | ||
|
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.
This default is being specified in multiple places - in the argument parsing and here. From what I can tell, the
environment
param should always be non-null when we get to this point, so we can remove thisor
check.