Skip to content

Commit

Permalink
upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ydshieh committed Jul 26, 2024
1 parent 8da9068 commit 6350f02
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions utils/notification_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,27 @@ def post_reply(self):
with open(file_path, "w", encoding="UTF-8") as fp:
fp.write(failure_text)

client.chat_postMessage(
channel=SLACK_REPORT_CHANNEL_ID,
text="Results for new failures",
blocks=blocks,
thread_ts=self.thread_ts["ts"],
)

try:
# Call the files.upload method using the WebClient
# Uploading files requires the `files:write` scope
result = client.files_upload(
channels=SLACK_REPORT_CHANNEL_ID,
initial_comment="Here's my file :smile:",
file=file_path,
)
# Log the result
logger.info(result)

except SlackApiError as e:
logger.error("Error uploading file: {}".format(e))


def retrieve_artifact(artifact_path: str, gpu: Optional[str]):
if gpu not in [None, "single", "multi"]:
Expand Down

0 comments on commit 6350f02

Please sign in to comment.