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

Fixes to Localstack setup, and additional installation instructions #2472

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ Node 20

NodeJS: https://nodejs.org/en/download/

After installing node, ensure you are running Yarn version 4.4.0 to match the project's package.json. With a terminal do:
- Install yarn via npm to start: `npm install -g yarn`
- Upgrade to newest yarn (also known as Berry): `yarn set version 4.4.0`
- Validate correct version is installed: `yarn --version`

### Redis

Redis Server:
Expand All @@ -43,6 +48,22 @@ You may follow the installation guidelines from the localstack site. The recomme

Once localstack is installed, you can start the server in the background with the CLI: `localstack start --detached`. You can see the status with `localstack status`.

*Note*: Localstack community edition (eg. without a pro account) does not persist anything to disk once the container is stopped.

#### AWSLocal CLI (for Localstack)

The awslocal CLI used by this project (https://github.com/localstack/awscli-local) is required for initial setup of the localstack resources used by Cube Cobra.

First install Python (suggest Python 3) and pip for your operating system. Sample instructions for a linux environment are:
- Ensure Virtual environment package is installed: `sudo apt-get install python3-venv`
- Create a virtual environment in your home directory: `python3 -m venv ~/venv`
- Add the virtual environment to your path: `export PATH=~/venv/bin:$PATH`
- Also add to your startup profile script (eg. bash profile) the activation of the virtual environment: `source ~/venv/bin/activate`
- Install awslocal: `pip3 install "awscli-local[ver1]"`
- Validate install: `awslocal --version`
- Will pass and print some "aws-cli" version (likely 1.X) for the system


### Code Editor (IDE)

VSCode (strongly recommended, but not required): https://code.visualstudio.com/
Expand Down
2 changes: 1 addition & 1 deletion one_shot_scripts/create_local_files.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from 'fs';
const fs = require('fs');
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to run this with import gave an error about only modules being allowed to use import. The other one shot scripts use require and that made it executable, so even though my experience with ES6 imports vs CommonJS is minor this seems the correct resolution


fs.mkdirSync('model/', { recursive: true });
fs.writeFileSync('model/elos.json', '[]');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"sync-podcasts": "node --max-old-space-size=4096 jobs/update_podcasts.js",
"start:localstack": "./scripts/local/start_localstack.sh",
"setup:local": "yarn start:localstack && yarn setup:local:env && yarn setup:local:localstack && yarn setup:local:files && yarn setup:local:db && yarn update-cards",
"setup:local:localstack": "./scripts/init_localstack.sh",
"setup:local:localstack": "./scripts/local/init_localstack.sh",
"setup:local:env": "cp .env_EXAMPLE .env",
"setup:local:files": "node one_shot_scripts/create_local_files.js",
"setup:local:db": "node --max-old-space-size=4096 one_shot_scripts/createTables.js",
Expand Down