Skip to content

Commit 4348587

Browse files
authored
Fix lambda package name (#4419)
* Fix lambda package name * Automatically infer last version * Use aws-beta- as tag name * Add instruction about virtualenv to tutorial * Fix release name
1 parent 59e769a commit 4348587

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

.github/workflows/publish_lambda_packages.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and publish AWS Lambda packages
33
on:
44
push:
55
tags:
6-
- "lambda-beta-*"
6+
- "aws-lambda-beta-*"
77

88
jobs:
99
build-lambdas:
@@ -19,10 +19,6 @@ jobs:
1919
run: pip install ./distribution/lambda
2020
- name: Mypy lint
2121
run: mypy distribution/lambda/
22-
23-
- name: Extract asset version of release
24-
run: echo "QW_LAMBDA_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
25-
if: ${{ github.event_name == 'push' }}
2622
- name: Retrieve and export commit date, hash, and tags
2723
run: |
2824
echo "QW_COMMIT_DATE=$(TZ=UTC0 git log -1 --format=%cd --date=format-local:%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_ENV
@@ -49,4 +45,4 @@ jobs:
4945
file: ${{ env.SEARCHER_PACKAGE_LOCATION }};${{ env.INDEXER_PACKAGE_LOCATION }}
5046
overwrite: true
5147
draft: true
52-
tag_name: aws-${{ env.QW_LAMBDA_VERSION }}
48+
tag_name: ${{ github.ref_name }}

distribution/lambda/Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
SHELL := bash
44
.SHELLFLAGS := -eu -o pipefail -c
55

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

68-
destroy-hdfs:
68+
# address https://github.com/aws/aws-cdk/issues/20060
69+
before-destroy:
70+
touch $(INDEXER_PACKAGE_PATH)
71+
touch $(SEARCHER_PACKAGE_PATH)
72+
73+
destroy-hdfs: before-destroy
6974
cdk destroy -a cdk/app.py HdfsStack
7075

71-
destroy-mock-data:
76+
destroy-mock-data: before-destroy
7277
cdk destroy -a cdk/app.py MockDataStack
7378

7479
clean:

distribution/lambda/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Prerequisites
55

66
- Install AWS CDK Toolkit (cdk command)
7-
- `npm install -g aws-cdk `
7+
- `npm install -g aws-cdk`
88
- Ensure `curl` and `make` are installed
99
- To run the invocation example `make` commands, you will also need Python 3.10
1010
or later and `pip` installed (see [Python venv](#python-venv) below).

docs/get-started/tutorials/tutorial-aws-lambda.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ Before running a system in the Cloud, it is always a good idea to get a rough es
8383

8484
### Prerequisites
8585

86-
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):
86+
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):
8787
```bash
88-
npm install -g aws-cdk
88+
npm install -g aws-cdk@latest
8989
```
9090
We also use the `curl` and `make` commands. For instance on Debian based distributions:
9191
```bash
@@ -94,11 +94,15 @@ sudo apt update && sudo apt install curl make
9494

9595
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).
9696

97-
Finally, clone the Quickwit repository:
97+
Finally, clone the Quickwit repository and install the Python dependencies (Python3.10 required) in a virtual environment:
9898
```bash
9999
git clone https://github.com/quickwit-oss/quickwit.git
100100
cd quickwit/distribution/lambda
101+
python3 -m venv .venv
102+
source .venv/bin/activate
103+
pip install .
101104
```
105+
102106
### Deploy
103107
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:
104108
```bash

0 commit comments

Comments
 (0)