Skip to content

Commit

Permalink
Fix lambda package name (#4419)
Browse files Browse the repository at this point in the history
* Fix lambda package name

* Automatically infer last version

* Use aws-beta- as tag name

* Add instruction about virtualenv to tutorial

* Fix release name
  • Loading branch information
rdettai committed Jan 18, 2024
1 parent 59e769a commit 4348587
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/publish_lambda_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and publish AWS Lambda packages
on:
push:
tags:
- "lambda-beta-*"
- "aws-lambda-beta-*"

jobs:
build-lambdas:
Expand All @@ -19,10 +19,6 @@ jobs:
run: pip install ./distribution/lambda
- name: Mypy lint
run: mypy distribution/lambda/

- name: Extract asset version of release
run: echo "QW_LAMBDA_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
if: ${{ github.event_name == 'push' }}
- name: Retrieve and export commit date, hash, and tags
run: |
echo "QW_COMMIT_DATE=$(TZ=UTC0 git log -1 --format=%cd --date=format-local:%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_ENV
Expand All @@ -49,4 +45,4 @@ jobs:
file: ${{ env.SEARCHER_PACKAGE_LOCATION }};${{ env.INDEXER_PACKAGE_LOCATION }}
overwrite: true
draft: true
tag_name: aws-${{ env.QW_LAMBDA_VERSION }}
tag_name: ${{ github.ref_name }}
13 changes: 9 additions & 4 deletions distribution/lambda/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c

# Update this when cutting a new release
QW_LAMBDA_VERSION?=beta-01
QW_LAMBDA_VERSION?=$(shell git tag --sort=committerdate | grep -E "aws-lambda-beta-" | tail -1 | cut -b 12-)
$(if $(QW_LAMBDA_VERSION),,$(error "Version tag not found, try 'git fetch --tags' or specify QW_LAMBDA_VERSION=beta-<version>"))
PACKAGE_BASE_URL=https://github.com/quickwit-oss/quickwit/releases/download/aws-lambda-$(QW_LAMBDA_VERSION)/
SEARCHER_PACKAGE_FILE=quickwit-lambda-searcher-$(QW_LAMBDA_VERSION)-x86_64.zip
INDEXER_PACKAGE_FILE=quickwit-lambda-indexer-$(QW_LAMBDA_VERSION)-x86_64.zip
Expand Down Expand Up @@ -65,10 +65,15 @@ deploy-hdfs: package check-env
deploy-mock-data: package check-env
cdk deploy -a cdk/app.py MockDataStack

destroy-hdfs:
# address https://github.com/aws/aws-cdk/issues/20060
before-destroy:
touch $(INDEXER_PACKAGE_PATH)
touch $(SEARCHER_PACKAGE_PATH)

destroy-hdfs: before-destroy
cdk destroy -a cdk/app.py HdfsStack

destroy-mock-data:
destroy-mock-data: before-destroy
cdk destroy -a cdk/app.py MockDataStack

clean:
Expand Down
2 changes: 1 addition & 1 deletion distribution/lambda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Prerequisites

- Install AWS CDK Toolkit (cdk command)
- `npm install -g aws-cdk `
- `npm install -g aws-cdk`
- Ensure `curl` and `make` are installed
- To run the invocation example `make` commands, you will also need Python 3.10
or later and `pip` installed (see [Python venv](#python-venv) below).
Expand Down
10 changes: 7 additions & 3 deletions docs/get-started/tutorials/tutorial-aws-lambda.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ Before running a system in the Cloud, it is always a good idea to get a rough es

### Prerequisites

We use [AWS CDK](https://aws.amazon.com/cdk/) for our infrastructure automation script. Install it using [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm):
We use [AWS CDK](https://aws.amazon.com/cdk/) for our infrastructure automation script. Install or upgrade it using [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm):
```bash
npm install -g aws-cdk
npm install -g aws-cdk@latest
```
We also use the `curl` and `make` commands. For instance on Debian based distributions:
```bash
Expand All @@ -94,11 +94,15 @@ sudo apt update && sudo apt install curl make

You also need AWS credentials to be properly configured in your shell. One way is using the [credentials file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html).

Finally, clone the Quickwit repository:
Finally, clone the Quickwit repository and install the Python dependencies (Python3.10 required) in a virtual environment:
```bash
git clone https://github.com/quickwit-oss/quickwit.git
cd quickwit/distribution/lambda
python3 -m venv .venv
source .venv/bin/activate
pip install .
```

### Deploy
Configure the AWS region and [account id](https://docs.aws.amazon.com/IAM/latest/UserGuide/console_account-alias.html) where you want to deploy the example stack:
```bash
Expand Down

0 comments on commit 4348587

Please sign in to comment.