Skip to content

Commit

Permalink
Fixed Failed Kokoro Test (Dataproc) (#1203)
Browse files Browse the repository at this point in the history
* Fixed Failed Kokoro Test (Dataproc)

* Fixed Lint Error

* Update dataproc_e2e_test.py

* Update dataproc_e2e_test.py

* Fixing More Lint Errors

* Fixed b/65407087

* Revert "Merge branch 'master' of https://github.com/michaelawyu/python-docs-samples"

This reverts commit 1614c7d, reversing
changes made to cd1dbfd.

* Revert "Fixed b/65407087"

This reverts commit cd1dbfd.

* Fixed Lint Error

* Fixed Lint Error
  • Loading branch information
michaelawyu authored and Jon Wayne Parrott committed Nov 8, 2017
1 parent 567ef35 commit c046426
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 1 addition & 4 deletions dataproc/dataproc_e2e_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@

import os

from gcp_devrel.testing.flaky import flaky

import submit_job_to_cluster

PROJECT = os.environ['GCLOUD_PROJECT']
BUCKET = os.environ['CLOUD_STORAGE_BUCKET']
CLUSTER_NAME = 'testcluster2'
CLUSTER_NAME = 'testcluster3'
ZONE = 'us-central1-b'


@flaky
def test_e2e():
output = submit_job_to_cluster.main(
PROJECT, ZONE, CLUSTER_NAME, BUCKET)
Expand Down
12 changes: 10 additions & 2 deletions dataproc/submit_job_to_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
def get_default_pyspark_file():
"""Gets the PySpark file from this directory"""
current_dir = os.path.dirname(os.path.abspath(__file__))
f = open(os.path.join(current_dir, DEFAULT_FILENAME), 'r')
f = open(os.path.join(current_dir, DEFAULT_FILENAME), 'rb')
return f, DEFAULT_FILENAME


def get_pyspark_file(filename):
f = open(filename, 'r')
f = open(filename, 'rb')
return f, os.path.basename(filename)


Expand Down Expand Up @@ -76,6 +76,14 @@ def create_cluster(dataproc, project, zone, region, cluster_name):
'config': {
'gceClusterConfig': {
'zoneUri': zone_uri
},
'masterConfig': {
'numInstances': 1,
'machineTypeUri': 'n1-standard-1'
},
'workerConfig': {
'numInstances': 2,
'machineTypeUri': 'n1-standard-1'
}
}
}
Expand Down

0 comments on commit c046426

Please sign in to comment.