Skip to content

Commit 21c0128

Browse files
committed
test 4
1 parent a90f15e commit 21c0128

File tree

2 files changed

+21
-31
lines changed

2 files changed

+21
-31
lines changed

.github/workflows/run_benchmark_multi_table.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ jobs:
3333
3434
- name: Run SDGym Benchmark
3535
env:
36-
GCP_SERVICE_ACCOUNT_JSON: ${{ secrets.GCP_CREDENTIALS_JSON }}
37-
SDV_ENTERPRISE_USERNAME: ${{ secrets.GCP_USERNAME }}
38-
SDV_ENTERPRISE_LICENSE_KEY: ${{ secrets.GCP_LICENSE_KEY }}
36+
GCP_SERVICE_ACCOUNT_JSON: ${{ secrets.GCP_SERVICE_ACCOUNT_JSON }}
37+
SDV_ENTERPRISE_USERNAME: ${{ secrets.SDV_ENTERPRISE_USERNAME }}
38+
SDV_ENTERPRISE_LICENSE_KEY: ${{ secrets.SDV_ENTERPRISE_LICENSE_KEY }}
3939
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
4040
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
41-
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
4241
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
4342
run: |
4443
export CREDENTIALS_FILEPATH=$(python -c "from sdgym._benchmark.credentials_utils import create_credentials_file; print(create_credentials_file())")

sdgym/_benchmark/credentials_utils.py

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -74,33 +74,24 @@ def sdv_install_cmd(credentials):
7474
)
7575

7676

77-
def create_credentials_file(filepath, credentials=None):
78-
"""Create a credentials file.
79-
80-
Args:
81-
filepath (str): The path to the credentials file.
82-
credentials (dict):
83-
The credentials to write to the file. If None, credential will be defined
84-
based on environment variables. Defaults to None.
85-
"""
86-
if credentials is None:
87-
gcp_json = os.getenv('GCP_SERVICE_ACCOUNT_JSON')
88-
89-
credentials = {
90-
'aws': {
91-
'aws_access_key_id': os.getenv('AWS_ACCESS_KEY_ID'),
92-
'aws_secret_access_key': os.getenv('AWS_SECRET_ACCESS_KEY'),
93-
},
94-
'gcp': {
95-
**json.loads(gcp_json),
96-
'gcp_project': 'sdgym-337614',
97-
'gcp_zone': 'us-central1-a',
98-
},
99-
'sdv': {
100-
'username': os.getenv('SDV_ENTERPRISE_USERNAME'),
101-
'license_key': os.getenv('SDV_ENTERPRISE_LICENSE_KEY'),
102-
},
103-
}
77+
def create_credentials_file():
78+
"""Create a credentials file."""
79+
gcp_json = os.getenv('GCP_SERVICE_ACCOUNT_JSON')
80+
credentials = {
81+
'aws': {
82+
'aws_access_key_id': os.getenv('AWS_ACCESS_KEY_ID'),
83+
'aws_secret_access_key': os.getenv('AWS_SECRET_ACCESS_KEY'),
84+
},
85+
'gcp': {
86+
**json.loads(gcp_json),
87+
'gcp_project': 'sdgym-337614',
88+
'gcp_zone': 'us-central1-a',
89+
},
90+
'sdv': {
91+
'username': os.getenv('SDV_ENTERPRISE_USERNAME'),
92+
'license_key': os.getenv('SDV_ENTERPRISE_LICENSE_KEY'),
93+
},
94+
}
10495

10596
tmp_file = NamedTemporaryFile(mode='w+', delete=False, suffix='.json')
10697
json.dump(credentials, tmp_file)

0 commit comments

Comments
 (0)