-
Notifications
You must be signed in to change notification settings - Fork 5
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
cloud deployment patch #52
base: v2-develop
Are you sure you want to change the base?
Conversation
source /var/run/agent/secrets/env | ||
|
||
/usr/bin/docker run -p 3000:3000 \ | ||
-v tokenizer:/app/node_modules/@anush008/tokenizers/ \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the same volume name 'tokenizer' for two different mount points can cause conflicts and unexpected behavior. Each volume should have a unique identifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless this is exactly the side effect you need.
Dockerfile
Outdated
@@ -35,7 +35,7 @@ RUN bun add better-sqlite3 | |||
|
|||
# Build the project | |||
RUN bun run build:core | |||
RUN bun run build:docker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a needed change
parent 777ee94 author mike dupont <mike.dupont@introspector.local> 1741968993 -0400 committer mike dupont <mike.dupont@introspector.local> 1742076983 -0400 revert Create test.yaml Update test.yaml Update tauri-ci.yml Update test.yaml Update integrationTests.yaml Update pr.yaml bun start bun update scripts update Update image.yaml adding docker one phase commit
420c8db
to
f338e53
Compare
@@ -0,0 +1,8 @@ | |||
|
|||
aws codebuild start-build --region us-east-2 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script doesn't verify AWS CLI installation or proper authentication before execution. Could fail with unclear error messages if AWS credentials are not configured.
#pnpm start --characters=$(ls -1p characters/*.json | paste -sd,) | ||
#fi | ||
#exec "$@" | ||
bun start # --characters=$(ls -1p characters/*.json | paste -sd,) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No check for bun installation or version compatibility before execution. Script might fail if bun is not installed or wrong version is present.
# part inside the "{}" is a workaround for the following bug in ash/dash: | ||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264 | ||
set -x | ||
#if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commented-out condition check means all commands are traced with strace, which is inefficient and could impact performance. Should be selective about what to trace.
apt update | ||
apt install -y strace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running apt commands without checking for root privileges can fail. Should include 'sudo' or check for root user first to ensure proper installation permissions.
|
||
|
||
#strace -f -o /opt/agent/strace.log -s99999 node CMD ["pnpm", "start", "--characters=characters/eliza.character.json"] | ||
strace -f -o /opt/agent/strace.log -s99999 bun start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No verification if 'bun' is installed before attempting to use it. Script should check for bun's existence and provide meaningful error if not found.
|
||
nvm use 23 | ||
pnpm clean | ||
pnpm install --no-frozen-lockfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using --no-frozen-lockfile can lead to inconsistent dependencies across environments. This could cause version mismatches and potential compatibility issues in production.
@@ -0,0 +1,21 @@ | |||
|
|||
nvm use 23 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node.js version 23 is not a stable release. Using unstable versions in a production environment can lead to unexpected behaviors and security vulnerabilities.
|
||
# This script expects AGENT_NAME to be set to something like "tine_agent" | ||
|
||
mkdir -p "/var/run/agent/secrets/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Directory creation lacks permission check and error handling. Script might fail silently if it lacks write permissions to /var/run/agent/, potentially causing subsequent operations to fail.
echo "" > "/var/run/agent/secrets/env" # blank the file | ||
|
||
# Fetch all variables with the prefix and name them the same as the variable minus agent name underscore | ||
for key in $(aws ssm describe-parameters --query 'Parameters[?starts_with(Name, `'"${AGENT_NAME}"'_`)].Name' --output text); do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS command execution lacks error handling and timeout settings. If AWS CLI is not configured or network issues occur, the script will continue with empty parameters.
@trag-bot didn't find any issues in the code! ✅✨ |
Pull request summary
|
Relates to
Risks
Background
What does this PR do?
What kind of change is this?
Documentation changes needed?
Testing
Where should a reviewer start?
Detailed testing steps