Skip to content

Commit 665d10c

Browse files
Merge pull request #284 from shelfio/feature/INDEXAPI-434-switch-to-node-18-amd64
Switch to: node 18, arm 64
2 parents bb0a1b1 + 0cde051 commit 665d10c

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ version: 2.1
77
parameters:
88
node_version:
99
type: string
10-
default: '16.15.0'
10+
default: '18.18.2'
1111

1212
commands:
1313
install_deps:

bin/tt.tar.gz

4.07 MB
Binary file not shown.

compile-tesseract.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Spin up and enter the docker container on your machine with the following command:
2-
# docker run -it --entrypoint /bin/bash public.ecr.aws/lambda/nodejs:16-x86_64
2+
# docker run -it --entrypoint /bin/bash public.ecr.aws/lambda/nodejs:18-arm64
33

44

55
# Then run the rest of the commands inside
@@ -23,7 +23,7 @@ make install
2323
cd ~
2424
git clone https://github.com/tesseract-ocr/tesseract.git
2525
cd tesseract
26-
git checkout 5.1.0
26+
git checkout 5.3.3
2727
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
2828
./autogen.sh
2929
./configure
@@ -61,6 +61,6 @@ strip ./tesseract-standalone/**/*
6161
tar -zcvf tesseract.tar.gz tesseract-standalone
6262

6363
# download from docker to local machine
64-
# 22e97e0774a0 is docker container id, you can look it up by running "docker ps"
64+
# d1c431e8c85e is docker container id, you can look it up by running "docker ps"
6565
# run this outside of the docker container
66-
docker cp 22e97e0774a0:/root/tesseract.tar.gz tt.tar.gz
66+
docker cp d1c431e8c85e:/root/tesseract.tar.gz tt.tar.gz

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@shelf/eslint-config": "3.10.0",
5858
"@shelf/prettier-config": "1.0.0",
5959
"@types/jest": "29.5.7",
60-
"@types/node": "16",
60+
"@types/node": "18",
6161
"@types/tar": "6.1.7",
6262
"eslint": "8.48.0",
6363
"husky": "8.0.3",
@@ -67,7 +67,7 @@
6767
"typescript": "5.2.2"
6868
},
6969
"engines": {
70-
"node": ">=16"
70+
"node": ">=18"
7171
},
7272
"publishConfig": {
7373
"access": "public"

readme.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# aws-lambda-tesseract [![CircleCI](https://circleci.com/gh/shelfio/aws-lambda-tesseract/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/aws-lambda-tesseract/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) [![Tesseract](https://img.shields.io/badge/tesserract-6_MB-brightgreen.svg)](bin/)
22

3-
> 6 MB Tesseract 5.1 (with English training data) to fit inside AWS Lambda
3+
> 6 MB Tesseract 5.3.3 (with English training data) to fit inside AWS Lambda
44
55
Inspired by [chrome-aws-lambda](https://github.com/alixaxel/chrome-aws-lambda) & [lambda-scanner-ocr](https://github.com/philippkeller/lambda-scanner-ocr)
66

@@ -18,9 +18,11 @@ $ yarn add @shelf/aws-lambda-tesseract
1818

1919
`4.x` works for Node 16.x runtime and compiled with **Tesseract 5.1.0**. It works with x86_64 CPUs for now only.
2020

21+
`5.x` works for Node 18.x runtime and compiled with **Tesseract 5.3.3**. It works with arm64 CPUs.
22+
2123
## How does it work?
2224

23-
This package contains an archive with [Tesseract 5.1](https://github.com/tesseract-ocr/tesseract) compiled for usage in AWS Lambda environment.
25+
This package contains an archive with [Tesseract 5.3.3](https://github.com/tesseract-ocr/tesseract) compiled for usage in AWS Lambda environment.
2426

2527
When a Lambda starts, it unpacks an archive with a binary to the `/tmp` folder and makes sure it's done only once per Lambda cold start.
2628

test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ yarn babel test.ts --out-file test.js
1212
docker run --rm \
1313
-v "$PWD":/var/task \
1414
-p 9000:8080 \
15-
public.ecr.aws/lambda/nodejs:16-x86_64 \
15+
public.ecr.aws/lambda/nodejs:18-arm64 \
1616
test.handler

0 commit comments

Comments
 (0)