-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove leftovers * script to export the execution of a spec as a page * improve readme
- Loading branch information
Showing
10 changed files
with
149 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fabricio Campos Zuardi <@fczuardi> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
# There be dragons | ||
# Latest Executed Specifications | ||
|
||
- [list-buckets with br-ne1 params](./list-buckets_params_br-ne1.md) | ||
- [list-buckets with br-se1 params](./list-buckets_params_br-se1.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# List buckets | ||
List all buckets from a profile[<sup>1</sup>](./glossary#profile) | ||
|
||
## Setup | ||
|
||
|
||
```python | ||
# Parameters | ||
profile_name = "default" | ||
``` | ||
|
||
|
||
```python | ||
# Parameters | ||
profile_name = "br-ne1" | ||
|
||
``` | ||
|
||
|
||
```python | ||
import datetime | ||
print(f'execution started at {datetime.datetime.now()}') | ||
``` | ||
|
||
execution started at 2024-10-25 10:00:07.887638 | ||
|
||
|
||
|
||
```python | ||
# Client instantiation | ||
import boto3 | ||
session = boto3.Session(profile_name=profile_name) | ||
s3_client = session.client('s3') | ||
``` | ||
|
||
## Example | ||
|
||
|
||
```python | ||
response = s3_client.list_buckets() | ||
buckets = response.get('Buckets') | ||
print(f"Profile '{profile_name}' has {len(buckets)} buckets.") | ||
|
||
import random | ||
print(f"One of those buckets is named {random.choice(buckets).get('Name')}") | ||
``` | ||
|
||
Profile 'br-ne1' has 19 buckets. | ||
One of those buckets is named test-br-ne1-1729485828 | ||
|
||
|
||
## References | ||
|
||
- https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/list_buckets.html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# List buckets | ||
List all buckets from a profile[<sup>1</sup>](./glossary#profile) | ||
|
||
## Setup | ||
|
||
|
||
```python | ||
# Parameters | ||
profile_name = "default" | ||
``` | ||
|
||
|
||
```python | ||
# Parameters | ||
profile_name = "br-se1" | ||
|
||
``` | ||
|
||
|
||
```python | ||
import datetime | ||
print(f'execution started at {datetime.datetime.now()}') | ||
``` | ||
|
||
execution started at 2024-10-25 10:10:36.457622 | ||
|
||
|
||
|
||
```python | ||
# Client instantiation | ||
import boto3 | ||
session = boto3.Session(profile_name=profile_name) | ||
s3_client = session.client('s3') | ||
``` | ||
|
||
## Example | ||
|
||
|
||
```python | ||
response = s3_client.list_buckets() | ||
buckets = response.get('Buckets') | ||
print(f"Profile '{profile_name}' has {len(buckets)} buckets.") | ||
|
||
import random | ||
print(f"One of those buckets is named {random.choice(buckets).get('Name')}") | ||
``` | ||
|
||
Profile 'br-se1' has 4 buckets. | ||
One of those buckets is named benchmark | ||
|
||
|
||
## References | ||
|
||
- https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/list_buckets.html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
profile_name: "br-ne1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
profile_name: "br-se1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# Check if the correct number of arguments are provided | ||
if [ "$#" -ne 3 ]; then | ||
echo "Usage: $0 <notebook_path> <yaml_params_path> <output_format>" | ||
exit 1 | ||
fi | ||
|
||
NOTEBOOK_PATH=$1 | ||
YAML_PARAMS=$2 | ||
OUTPUT_FORMAT=$3 | ||
EXECUTION_NAME=$(basename "$YAML_PARAMS" .yaml) | ||
PAPERMILL_OUTPUT_FOLDER="/tmp" | ||
OUTPUT_FOLDER="docs" | ||
|
||
# Step 1: Run the notebook with Papermill using the YAML file for parameters | ||
EXECUTED_NOTEBOOK="${PAPERMILL_OUTPUT_FOLDER}/$(basename "$NOTEBOOK_PATH" .ipynb)_${EXECUTION_NAME}.ipynb" | ||
papermill $NOTEBOOK_PATH $EXECUTED_NOTEBOOK -y "$(cat $YAML_PARAMS)" | ||
|
||
# Step 2: Convert the executed notebook to the specified format | ||
jupyter nbconvert --to $OUTPUT_FORMAT $EXECUTED_NOTEBOOK --output-dir $OUTPUT_FOLDER | ||
|