Skip to content

Commit

Permalink
[CHORE] Remove usage of credentials in workflows to allow PRs from fo…
Browse files Browse the repository at this point in the history
…rks to be green
  • Loading branch information
Jay Chia committed Nov 30, 2023
1 parent cb1fb22 commit d1377b6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 68 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,6 @@ jobs:
python-version: ['3.8'] # can't use 3.7 due to requiring anon mode for adlfs
daft-runner: [py, ray]
micropartitions: [1, 0]
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
# This is used in the step "Assume GitHub Actions AWS Credentials"
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -295,20 +290,6 @@ jobs:
run: |
mkdir -p /tmp/daft-integration-testing/nginx
chmod +rw /tmp/daft-integration-testing/nginx
- name: Assume GitHub Actions AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.ACTIONS_AWS_ROLE_ARN }}
role-session-name: DaftPythonPackageGitHubWorkflow
- name: Assume GitHub Actions GCloud Credentials
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.ACTIONS_GCP_SERVICE_ACCOUNT_JSON }}
# NOTE: Workload Identity seems to be having problems with our Rust crate, so we use JSON instead
# See issue: https://github.com/yoshidan/google-cloud-rust/issues/171#issuecomment-1730511655
# workload_identity_provider: ${{ secrets.ACTIONS_GCP_WORKLOAD_IDENTITY_PROVIDER }}
# service_account: ${{ secrets.ACTIONS_GCP_SERVICE_ACCOUNT }}
- name: Spin up IO services
uses: isbang/[email protected]
with:
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/io/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def aws_public_s3_config() -> daft.io.IOConfig:
s3=daft.io.S3Config(
# NOTE: no keys or endpoints specified for an AWS public s3 bucket
region_name="us-west-2",
# Use anonymous mode to avoid having to search for credentials in the Github Runner
anonymous=True,
)
)

Expand Down
16 changes: 6 additions & 10 deletions tests/integration/io/test_list_files_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from daft.daft import GCSConfig, IOConfig, io_glob

BUCKET = "daft-public-data-gs"
DEFAULT_GCS_CONFIG = GCSConfig(project_id=None, anonymous=None)
ANON_GCS_CONFIG = GCSConfig(project_id=None, anonymous=True)


Expand Down Expand Up @@ -52,29 +51,26 @@ def compare_gcs_result(daft_ls_result: list, fsspec_result: list):
)
@pytest.mark.parametrize("recursive", [False, True])
@pytest.mark.parametrize("fanout_limit", [None, 1])
@pytest.mark.parametrize("gcs_config", [DEFAULT_GCS_CONFIG, ANON_GCS_CONFIG])
def test_gs_flat_directory_listing(path, recursive, gcs_config, fanout_limit):
def test_gs_flat_directory_listing(path, recursive, fanout_limit):
fs = gcsfs.GCSFileSystem()
glob_path = path.rstrip("/") + "/**" if recursive else path
daft_ls_result = io_glob(glob_path, io_config=IOConfig(gcs=gcs_config), fanout_limit=fanout_limit)
daft_ls_result = io_glob(glob_path, io_config=IOConfig(gcs=ANON_GCS_CONFIG), fanout_limit=fanout_limit)
fsspec_result = gcsfs_recursive_list(fs, path) if recursive else fs.ls(path, detail=True)
compare_gcs_result(daft_ls_result, fsspec_result)


@pytest.mark.integration()
@pytest.mark.parametrize("recursive", [False, True])
@pytest.mark.parametrize("gcs_config", [DEFAULT_GCS_CONFIG, ANON_GCS_CONFIG])
def test_gs_single_file_listing(recursive, gcs_config):
def test_gs_single_file_listing(recursive):
path = f"gs://{BUCKET}/test_ls/file.txt"
fs = gcsfs.GCSFileSystem()
daft_ls_result = io_glob(path, io_config=IOConfig(gcs=gcs_config))
daft_ls_result = io_glob(path, io_config=IOConfig(gcs=ANON_GCS_CONFIG))
fsspec_result = gcsfs_recursive_list(fs, path) if recursive else fs.ls(path, detail=True)
compare_gcs_result(daft_ls_result, fsspec_result)


@pytest.mark.integration()
@pytest.mark.parametrize("gcs_config", [DEFAULT_GCS_CONFIG, ANON_GCS_CONFIG])
def test_gs_notfound(gcs_config):
def test_gs_notfound():
path = f"gs://{BUCKET}/test_"
with pytest.raises(FileNotFoundError, match=path):
io_glob(path, io_config=IOConfig(gcs=gcs_config))
io_glob(path, io_config=IOConfig(gcs=ANON_GCS_CONFIG))
39 changes: 0 additions & 39 deletions tests/integration/io/test_url_download_private_aws_s3.py

This file was deleted.

0 comments on commit d1377b6

Please sign in to comment.