Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#113 Added implementation for the SaaS Bucket. #116

Merged
merged 16 commits into from
May 2, 2024

Conversation

ahsimb
Copy link

@ahsimb ahsimb commented Apr 30, 2024

closes #113

Submission Checklist

  • Bumped version number
  • Updated Documentation
  • Updated API Documentation
  • Updated the changelog

@ahsimb ahsimb added the feature Product feature label Apr 30, 2024
@ahsimb ahsimb self-assigned this Apr 30, 2024
exasol/bucketfs/_buckets.py Outdated Show resolved Hide resolved
exasol/bucketfs/_buckets.py Outdated Show resolved Hide resolved
exasol/bucketfs/_buckets.py Outdated Show resolved Hide resolved
@@ -33,10 +33,14 @@ python = ">=3.8,<4.0"
requests = ">=2.24.0"
joblib=">=1.0.1"
typeguard = "4.0.0"
saas-api=">=0.2.0"
# Temp.fix
httpx=">=0.27.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the saas api also use requests?
Do we need async support? (If so we may also should migrate bucketfs to httpx at some point)

Copy link
Author

@ahsimb ahsimb May 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need the async support, based on the current definition of the BucketLike. May do in the future, but this is outside the scope of this ticket.

Comment on lines +60 to +95
def saas_test_database_id(saas_test_service_url, saas_test_token, saas_test_account_id) -> str:

with create_saas_test_client(
url=saas_test_service_url,
token=saas_test_token
) as client:
db: Optional[openapi.models.database.Database] = None
try:
db = create_saas_test_database(
account_id=saas_test_account_id,
client=client
)
# Wait till the database gets to the running state.
sleep_time = 600
small_interval = 20
max_wait_time = 2400
max_cycles = 1 + (max_wait_time - sleep_time) // small_interval
for _ in range(max_cycles):
time.sleep(sleep_time)
db = get_saas_database(
account_id=saas_test_account_id,
database_id=db.id,
client=client
)
if db.status == SaasStatus.RUNNING:
break
sleep_time = 30
else:
raise RuntimeError(f'Test SaaS database status is {db.status} '
f'after {max_wait_time} seconds.')
yield db.id
finally:
if db is not None:
delete_saas_database(
account_id=saas_test_account_id,
database_id=db.id,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't the saas api provide such a fixture?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet. It will soon. At which point we may want to update this repo. However, there is a bigger problem that we may need to address - the testing of the SaaS bucket can't be done in the normal check workflow of the Python Toolbox.

test_saas/integration/test_path.py Outdated Show resolved Hide resolved
test_saas/integration/test_path.py Outdated Show resolved Hide resolved
test_saas/integration/test_path.py Outdated Show resolved Hide resolved
Nicoretti
Nicoretti previously approved these changes May 2, 2024
Copy link
Member

@Nicoretti Nicoretti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, based the outcome of your logger.debug("%s", "value") vs logger.debug("{}", "value") investigation, either update or merge.

@ahsimb ahsimb merged commit 989e886 into main May 2, 2024
17 checks passed
@ahsimb ahsimb deleted the feature/113-saas-service-and-bucket branch May 2, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Product feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement the SaaS Service and Bucket
3 participants