Skip to content
This repository was archived by the owner on Feb 3, 2021. It is now read-only.

Commit e361c3b

Browse files
Feature: Readthedocs support (#497)
1 parent a00dbb7 commit e361c3b

34 files changed

+626
-850
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ indent_style = space
33
indent_size = 4
44
insert_final_newline = true
55
trim_trailing_whitespace = true
6+
end_of_line = lf
67

78
[*.{json,yml,yaml}]
89
indent_size = 2

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@ tmp/
3939

4040
# PyTest
4141
.cache/
42+
43+
44+
# Built docs
45+
docs/_build/

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@
1515
"python.formatting.yapfArgs": [
1616
"--style=.style.yapf"
1717
],
18-
"python.venvPath": "${workspaceFolder}/ENV",
1918
"python.pythonPath": "${workspaceFolder}\\ENV\\Scripts\\python.exe"
2019
}

aztk/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __delete_pool_and_job(self, pool_id: str, keep_logs: bool = False):
6161

6262
if pool_exists:
6363
self.batch_client.pool.delete(pool_id)
64-
64+
6565
if not keep_logs:
6666
cluster_data = self._get_cluster_data(pool_id)
6767
cluster_data.delete_container(pool_id)

aztk/error.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
"""
55

66

7-
87
class AztkError(Exception):
9-
def __init__(self, message: str=None):
10-
super().__init__(message)
8+
pass
119

1210
class ClusterNotReadyError(AztkError):
1311
pass
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from .blob_data import *
2-
from .node_data import *
3-
from .cluster_data import *
1+
from .blob_data import BlobData
2+
from .node_data import NodeData
3+
from .cluster_data import ClusterData

aztk/internal/cluster_data/cluster_data.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import yaml
21
import logging
2+
import yaml
33
import azure.common
4-
from azure.storage.blob import BlockBlobService
54
from .node_data import NodeData
65
from .blob_data import BlobData
76

@@ -15,7 +14,7 @@ class ClusterData:
1514
APPLICATIONS_DIR = "applications"
1615
CLUSTER_CONFIG_FILE = "config.yaml"
1716

18-
def __init__(self, blob_client: BlockBlobService, cluster_id: str):
17+
def __init__(self, blob_client, cluster_id: str):
1918
self.blob_client = blob_client
2019
self.cluster_id = cluster_id
2120
self._ensure_container()

aztk/internal/cluster_data/node_data.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pathlib import Path
66
from typing import List
77
import yaml
8-
from aztk.spark import models
8+
from aztk import models
99
from aztk.utils import constants, file_utils, secure_utils
1010
from aztk.error import InvalidCustomScriptError
1111

@@ -61,10 +61,12 @@ def add_files(self, file_paths: List[str], zip_dir, binary: bool = True):
6161
for file in file_paths:
6262
self.add_file(file, zip_dir, binary)
6363

64-
def add_dir(self, path: str, dest: str = None, exclude: List[str] = []):
64+
def add_dir(self, path: str, dest: str = None, exclude: List[str] = None):
6565
"""
6666
Zip all the files in the given directory into the zip file handler
6767
"""
68+
exclude = exclude or []
69+
6870
for base, _, files in os.walk(path):
6971
relative_folder = os.path.relpath(base, path)
7072
for file in files:
@@ -156,7 +158,8 @@ def _add_plugins(self):
156158
def _add_node_scripts(self):
157159
self.add_dir(os.path.join(ROOT_PATH, NODE_SCRIPT_FOLDER), NODE_SCRIPT_FOLDER, exclude=['*.pyc*'])
158160

159-
def _includeFile(self, filename: str, exclude: List[str] = []) -> bool:
161+
def _includeFile(self, filename: str, exclude: List[str]) -> bool:
162+
exclude = exclude or []
160163
for pattern in exclude:
161164
if fnmatch.fnmatch(filename, pattern):
162165
return False

aztk/spark/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
from .models import *
21
from .client import Client

aztk/spark/client.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,27 @@
1515

1616

1717
class Client(BaseClient):
18+
"""
19+
Aztk Spark Client
20+
This is the main entry point for using aztk for spark
21+
22+
Args:
23+
secrets_config(aztk.spark.models.models.SecretsConfiguration): Configuration with all the needed credentials
24+
"""
1825
def __init__(self, secrets_config):
1926
super().__init__(secrets_config)
2027

21-
'''
22-
Spark client public interface
23-
'''
2428
def create_cluster(self, cluster_conf: models.ClusterConfiguration, wait: bool = False):
29+
"""
30+
Create a new aztk spark cluster
31+
32+
Args:
33+
cluster_conf(aztk.spark.models.models.ClusterConfiguration): Configuration for the the cluster to be created
34+
wait(bool): If you should wait for the cluster to be ready before returning
35+
36+
Returns:
37+
aztk.spark.models.Cluster
38+
"""
2539
cluster_conf.validate()
2640
cluster_data = self._get_cluster_data(cluster_conf.cluster_id)
2741
try:

0 commit comments

Comments
 (0)