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

docs: aws CLI is required #70

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ paka cluster down -f cluster.yaml

## Dependencies
- docker daemon and CLI
- credentials for the AWS cloud
- AWS CLI
```bash
# Ensure your AWS credentials are correctly configured. Execute the command below and verify that the keys `aws_access_key_id` and `aws_secret_access_key` are present.
cat ~/.aws/credentials
# Ensure your AWS credentials are correctly configured.
aws configure
```
62 changes: 31 additions & 31 deletions examples/invoice_extraction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,52 @@ This code provides an example of how to build a RESTful API that converts an inv
Follow the steps below to run the example:

1. **Install the necessary dependencies:**
```bash
pip install paka
```bash
pip install paka

cat ~/.aws/credentials
# Make sure you have the following keys aws_access_key_id and aws_secret_access_key
```
# Install AWS CLI and ensure your AWS credentials are correctly configured.
aws configure
```

2. **Ensure the Docker daemon is running:**
```bash
docker info
```
```bash
docker info
```

3. **Provision the cluster:**
```bash
cd examples/invoice_extraction
```bash
cd examples/invoice_extraction

# Provision the cluster and update ~/.kube/config
paka cluster up -f cluster.yaml -u
# Provision the cluster and update ~/.kube/config
paka cluster up -f cluster.yaml -u

# Provision a cluster with Nvidia GPUs
paka cluster up -f gpu_cluster.yaml -u
```
# Provision a cluster with Nvidia GPUs
paka cluster up -f gpu_cluster.yaml -u
```

4. **Deploy the App:**
```bash
# The command below will build the source and deploy it as a serverless function.
paka function deploy --name invoice-extraction --source . --entrypoint serve
```
```bash
# The command below will build the source and deploy it as a serverless function.
paka function deploy --name invoice-extraction --source . --entrypoint serve
```

5. **Check the status of the functions:**
```bash
paka function list
```
```bash
paka function list
```

If everything is successful, you should see the function in the list with a status of "READY". By default, the function is exposed through a publicly accessible REST API endpoint.
If everything is successful, you should see the function in the list with a status of "READY". By default, the function is exposed through a publicly accessible REST API endpoint.

6. **Test the App:**

Submit the PDF invoices by hitting the `/extract_invoice` endpoint of the deployed function.
Submit the PDF invoices by hitting the `/extract_invoice` endpoint of the deployed function.

```bash
curl -X POST -H "Content-Type: multipart/form-data" -F "file=@/path/to/invoices/invoice-2024-02-29.pdf" http://invoice-extraction.default.xxxx.sslip.io/extract_invoice
```
```bash
curl -X POST -H "Content-Type: multipart/form-data" -F "file=@/path/to/invoices/invoice-2024-02-29.pdf" http://invoice-extraction.default.xxxx.sslip.io/extract_invoice
```

If the invoice extraction is successful, you should see the structured data in the response, e.g.
If the invoice extraction is successful, you should see the structured data in the response, e.g.

```json
{"number":"#25927345","date":"2024-01-31T05:07:53","company":"Akamai Technologies, Inc.","company_address":"249 Arch St. Philadelphia, PA 19106 USA","tax_id":"United States EIN: 04-3432319","customer":"John Doe","customer_address":"1 Hacker Way Menlo Park, CA 94025","amount":"$5.00"}
```
```json
{"number":"#25927345","date":"2024-01-31T05:07:53","company":"Akamai Technologies, Inc.","company_address":"249 Arch St. Philadelphia, PA 19106 USA","tax_id":"United States EIN: 04-3432319","customer":"John Doe","customer_address":"1 Hacker Way Menlo Park, CA 94025","amount":"$5.00"}
```
4 changes: 2 additions & 2 deletions examples/website_rag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ To run the example, first install the necessary dependencies:
```bash
pip install paka

# Ensure your AWS credentials are correctly configured. Execute the command below and verify that the keys `aws_access_key_id` and `aws_secret_access_key` are present.
cat ~/.aws/credentials
# Install AWS CLI and ensure your AWS credentials are correctly configured.
aws configure
```

### Make sure docker daemon is running
Expand Down
Loading