mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Merge pull request #226 from Hestia-Homes/main
Allowing all s3 permissions for predictions bucket for sapmodel
This commit is contained in:
commit
bafba8f4c6
2 changed files with 5 additions and 10 deletions
|
|
@ -399,17 +399,11 @@ async def trigger_plan(body: PlanTriggerRequest):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Retrieve the predictions
|
# Retrieve the predictions
|
||||||
logger.info("Retrieving predictions from s3")
|
|
||||||
test = read_csv_from_s3(
|
|
||||||
bucket_name="retrofit-sap-predictions-{environment}".format(environment=get_settings().ENVIRONMENT),
|
|
||||||
filepath=response["storage_filepath"]
|
|
||||||
)
|
|
||||||
|
|
||||||
predictions = pd.DataFrame(read_csv_from_s3(
|
predictions = pd.DataFrame(read_csv_from_s3(
|
||||||
bucket_name="retrofit-sap-predictions-{environment}".format(environment=get_settings().ENVIRONMENT),
|
bucket_name="retrofit-sap-predictions-{environment}".format(environment=get_settings().ENVIRONMENT),
|
||||||
filepath=response["storage_filepath"]
|
filepath=response["storage_filepath"]
|
||||||
))
|
))
|
||||||
|
|
||||||
# We round the predictions
|
# We round the predictions
|
||||||
predictions["RDSAP_CHANGE"] = predictions["RDSAP_CHANGE"].astype(float).round(0)
|
predictions["RDSAP_CHANGE"] = predictions["RDSAP_CHANGE"].astype(float).round(0)
|
||||||
# Extract property_id and recommendation_id
|
# Extract property_id and recommendation_id
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,10 @@ provider:
|
||||||
# Allow reading and writing to PREDICTIONS_BUCKET
|
# Allow reading and writing to PREDICTIONS_BUCKET
|
||||||
- Effect: Allow
|
- Effect: Allow
|
||||||
Action:
|
Action:
|
||||||
- s3:GetObject
|
- s3:*
|
||||||
- s3:PutObject
|
# - s3:GetObject
|
||||||
- s3:ListBucket
|
# - s3:PutObject
|
||||||
|
# - s3:ListBucket
|
||||||
Resource:
|
Resource:
|
||||||
- arn:aws:s3:::${env:PREDICTIONS_BUCKET}
|
- arn:aws:s3:::${env:PREDICTIONS_BUCKET}
|
||||||
- arn:aws:s3:::${env:PREDICTIONS_BUCKET}/*
|
- arn:aws:s3:::${env:PREDICTIONS_BUCKET}/*
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue