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

cloud deployment patch #52

Open
wants to merge 2 commits into
base: v2-develop
Choose a base branch
from

Conversation

jmikedupont2
Copy link
Member

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

source /var/run/agent/secrets/env

/usr/bin/docker run -p 3000:3000 \
-v tokenizer:/app/node_modules/@anush008/tokenizers/ \
Copy link

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.

Copy link
Member Author

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
Copy link
Member Author

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
@jmikedupont2 jmikedupont2 force-pushed the feature/v2/cloud-deploy-v2 branch from 420c8db to f338e53 Compare March 15, 2025 22:18
@@ -0,0 +1,8 @@

aws codebuild start-build --region us-east-2 \
Copy link

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,)
Copy link

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
Copy link

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.

Comment on lines +9 to +10
apt update
apt install -y strace
Copy link

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
Copy link

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
Copy link

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
Copy link

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/"
Copy link

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
Copy link

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.

Copy link

trag-bot bot commented Mar 15, 2025

@trag-bot didn't find any issues in the code! ✅✨

Copy link

trag-bot bot commented Mar 15, 2025

Pull request summary

  • Added a new environment variable DEVREL_IMPORT_KNOWLEDGE to the .env.example file.
  • Updated the GitHub Actions workflow for Docker image creation to include new steps for setting up Docker Buildx and logging into Docker Hub.
  • Modified the integration tests workflow to allow manual triggering via workflow_dispatch instead of only on push or pull request events.
  • Changed the PR title check workflow to support manual triggering.
  • Updated the Tauri CI workflow to allow manual triggering.
  • Created a new Docker Compose file to define services for PostgreSQL and the Eliza application, including health checks and environment variables.
  • Added new shell scripts for AWS commands to update and build the application.
  • Updated the package.json and lerna.json files to reflect new versions and dependencies.
  • Enhanced the character configuration in the Eliza application to conditionally load plugins based on environment variables.
  • Updated various dependencies in the project to their latest versions, including bun, @babel/generator, and socket.io.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant