You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/08/26 10:43:48 UTC
[GitHub] [airflow] antoniocali opened a new pull request #10578: Add masterConfig parameter to MLEngineStartTrainingJobOperator
antoniocali opened a new pull request #10578:
URL: https://github.com/apache/airflow/pull/10578
**Jira**
My PR addresses the following Airflow Jira issues and references them in the PR title.
https://issues.apache.org/jira/browse/AAR-487
**Description**
_Why this is important?_
At the moment when you spin up a training, you cannot specify an accelerator, so when you end up with a CUSTOM tier and a standard machine, you cannot add GPUs that would speed up the training process.
_Documentation_
It refers to the follow [REST API Documentation](https://cloud.google.com/ai-platform/training/docs/reference/rest/v1/projects.jobs#traininginput).
> Optional. The configuration for your master worker.
>
> You should only set masterConfig.acceleratorConfig if masterType is set to a Compute Engine machine type. Learn about restrictions on accelerator configurations for training.
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] boring-cyborg[bot] commented on pull request #10578: Add masterConfig parameter to MLEngineStartTrainingJobOperator
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #10578:
URL: https://github.com/apache/airflow/pull/10578#issuecomment-687413011
Awesome work, congrats on your first merged pull request!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] boring-cyborg[bot] commented on pull request #10578: Add masterConfig parameter to MLEngineStartTrainingJobOperator
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #10578:
URL: https://github.com/apache/airflow/pull/10578#issuecomment-680803369
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
Here are some useful points:
- Pay attention to the quality of your code (flake8, pylint and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/master/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) will help you with that.
- In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/master/docs/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
- Consider using [Breeze environment](https://github.com/apache/airflow/blob/master/BREEZE.rst) for testing locally, itโs a heavy docker but it ships with a working Airflow and a lot of integrations.
- Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
- Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
- Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#coding-style-and-best-practices).
Apache Airflow is a community-driven project and together we are making it better ๐.
In case of doubts contact the developers at:
Mailing List: dev@airflow.apache.org
Slack: https://apache-airflow-slack.herokuapp.com/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] antoniocali commented on pull request #10578: Add masterConfig parameter to MLEngineStartTrainingJobOperator
Posted by GitBox <gi...@apache.org>.
antoniocali commented on pull request #10578:
URL: https://github.com/apache/airflow/pull/10578#issuecomment-680837700
It seems spell checks failed but I don't recognize where is the error. If someone would help me with this
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on pull request #10578: Add masterConfig parameter to MLEngineStartTrainingJobOperator
Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #10578:
URL: https://github.com/apache/airflow/pull/10578#issuecomment-682631299
Can you add tests to avoid regression?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] antoniocali commented on a change in pull request #10578: Add masterConfig parameter to MLEngineStartTrainingJobOperator
Posted by GitBox <gi...@apache.org>.
antoniocali commented on a change in pull request #10578:
URL: https://github.com/apache/airflow/pull/10578#discussion_r483426666
##########
File path: tests/providers/google/cloud/operators/test_mlengine.py
##########
@@ -350,6 +350,45 @@ def test_success_create_training_job(self, mock_hook):
project_id='test-project', job=self.TRAINING_INPUT, use_existing_job_fn=ANY
)
+ @patch('airflow.providers.google.cloud.operators.mlengine.MLEngineHook')
+ def test_success_create_training_job_with_master_config(self, mock_hook):
+ custom_training_default_args: dict = copy.deepcopy(self.TRAINING_DEFAULT_ARGS)
+ custom_training_default_args['scaleTier'] = 'CUSTOM'
Review comment:
I'm trying to understand how to write correctly the test honestly
This is the class
[class TestMLEngineTrainingOperator](https://github.com/apache/airflow/blob/93aceab53ae9552f77f3bddf1b51d3e06c988cd2/tests/providers/google/cloud/operators/test_mlengine.py#L306)
If you take a look at the class there are 2 dictionary
`TRAINING_DEFAULT_ARGS` and `TRAINING_INPUT`, both of them contain a scale_tier/scaleTier parameter.
The thing is that I have to overwrite that to CUSTOM to be able to run a masterType and masterConfig.
if you look at the [Rest Documentation](https://cloud.google.com/ai-platform/training/docs/reference/rest/v1/projects.jobs#traininginput), it shows a trainingInput config, where scaleTier appears -> As much as I know from my understanding, all of Google Operators at the end just do a HookBase Operator that does a rest api call.
I'm tring to fully understand why the test fails, anyway I've prepared a new commit and trying to verify. Thank you @mik-laj for your support, and if you have a better idea how to solve it please let me know
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj merged pull request #10578: Add masterConfig parameter to MLEngineStartTrainingJobOperator
Posted by GitBox <gi...@apache.org>.
mik-laj merged pull request #10578:
URL: https://github.com/apache/airflow/pull/10578
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] mik-laj commented on a change in pull request #10578: Add masterConfig parameter to MLEngineStartTrainingJobOperator
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #10578:
URL: https://github.com/apache/airflow/pull/10578#discussion_r483305793
##########
File path: tests/providers/google/cloud/operators/test_mlengine.py
##########
@@ -350,6 +350,45 @@ def test_success_create_training_job(self, mock_hook):
project_id='test-project', job=self.TRAINING_INPUT, use_existing_job_fn=ANY
)
+ @patch('airflow.providers.google.cloud.operators.mlengine.MLEngineHook')
+ def test_success_create_training_job_with_master_config(self, mock_hook):
+ custom_training_default_args: dict = copy.deepcopy(self.TRAINING_DEFAULT_ARGS)
+ custom_training_default_args['scaleTier'] = 'CUSTOM'
Review comment:
```suggestion
```
I don't think this parameter exists.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] antoniocali commented on a change in pull request #10578: Add masterConfig parameter to MLEngineStartTrainingJobOperator
Posted by GitBox <gi...@apache.org>.
antoniocali commented on a change in pull request #10578:
URL: https://github.com/apache/airflow/pull/10578#discussion_r483457605
##########
File path: tests/providers/google/cloud/operators/test_mlengine.py
##########
@@ -350,6 +350,45 @@ def test_success_create_training_job(self, mock_hook):
project_id='test-project', job=self.TRAINING_INPUT, use_existing_job_fn=ANY
)
+ @patch('airflow.providers.google.cloud.operators.mlengine.MLEngineHook')
+ def test_success_create_training_job_with_master_config(self, mock_hook):
+ custom_training_default_args: dict = copy.deepcopy(self.TRAINING_DEFAULT_ARGS)
+ custom_training_default_args['scaleTier'] = 'CUSTOM'
Review comment:
It seems you were right btw :) Thank you @mik-laj
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org