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

Reintroducing just the packaging changes #38

Open
wants to merge 1 commit into
base: develop
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
181 changes: 181 additions & 0 deletions .altostra/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
{
"id": "cloud-deployment-eliza-2",
"name": "cloud-deployment-eliza-2",
"type": "altostra",
"description": "A simple CRUD service template",
"created": "2025-03-05T09:20:09.663Z",
"blueprints": [
{
"connections": {
"ApiEndpoint01": {
"HandleResources01": {
"from": "ApiEndpoint01",
"to": "HandleResources01",
"type": "connection.trigger"
}
},
"ApiEndpoint02": {
"HandleResources01": {
"from": "ApiEndpoint02",
"to": "HandleResources01",
"type": "connection.trigger"
}
},
"ApiEndpoint03": {
"HandleResources01": {
"from": "ApiEndpoint03",
"to": "HandleResources01",
"type": "connection.trigger"
}
},
"ApiEndpoint04": {
"HandleResources01": {
"from": "ApiEndpoint04",
"to": "HandleResources01",
"type": "connection.trigger"
}
},
"Data01": {},
"HandleResources01": {
"Data01": {
"accessLevel": "read-write",
"from": "HandleResources01",
"to": "Data01",
"type": "connection.resource-access"
}
}
},
"id": "cloud-deployment-eliza-2",
"metadata": {
"designer": {
"resourcePositions": {
"Api01": {
"x": 41,
"y": 229,
"z": 0
},
"Data01": {
"x": 645,
"y": 299,
"z": 0
},
"HandleResources01": {
"x": 357,
"y": 300,
"z": 0
}
}
}
},
"name": "cloud-deployment-eliza-2",
"resources": {
"Api01": {
"cors": {
"type": "api.cors.simple",
"origins": "*"
},
"endpoints": [
{
"id": "ApiEndpoint01",
"type": "ref"
},
{
"id": "ApiEndpoint02",
"type": "ref"
},
{
"id": "ApiEndpoint03",
"type": "ref"
},
{
"id": "ApiEndpoint04",
"type": "ref"
}
],
"id": "Api01",
"name": "api",
"type": "resource.api"
},
"ApiEndpoint01": {
"api": {
"id": "Api01",
"type": "ref"
},
"id": "ApiEndpoint01",
"method": "GET",
"name": "api-endpoint-0",
"path": "/resource/{resourceId}",
"type": "resource.api.endpoint"
},
"ApiEndpoint02": {
"api": {
"id": "Api01",
"type": "ref"
},
"id": "ApiEndpoint02",
"method": "POST",
"name": "api-endpoint-0",
"path": "/resource",
"type": "resource.api.endpoint"
},
"ApiEndpoint03": {
"api": {
"id": "Api01",
"type": "ref"
},
"id": "ApiEndpoint03",
"method": "PUT",
"name": "api-endpoint-0",
"path": "/resource/{resourceId}",
"type": "resource.api.endpoint"
},
"ApiEndpoint04": {
"api": {
"id": "Api01",
"type": "ref"
},
"id": "ApiEndpoint04",
"method": "GET",
"name": "api-endpoint-3",
"path": "/resource",
"type": "resource.api.endpoint"
},
"Data01": {
"aws": {
"billingModel": "PROVISIONED",
"throughput": {
"readUnits": 5,
"writeUnits": 5
}
},
"id": "Data01",
"key": {
"hash": {
"name": "pk",
"type": "STRING"
},
"range": {
"name": "sk",
"type": "STRING"
}
},
"name": "data",
"tableName": "data",
"type": "resource.table"
},
"HandleResources01": {
"entryPoint": "functions/handleResources.handler",
"id": "HandleResources01",
"layers": [],
"memory": 512,
"name": "handle-resource",
"runtime": "nodejs16.x",
"timeout": 6,
"type": "resource.compute.function"
}
},
"unsafe": false,
"version": "2019-10-24"
}
]
}
14 changes: 7 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
steps:
- uses: actions/checkout@v4
- uses: meta-introspector/checkout@v4

- uses: pnpm/action-setup@v3
- uses: meta-introspector/action-setup@v3
with:
version: 9.15.0

- uses: actions/setup-node@v4
- uses: meta-introspector/setup-node@v4
with:
node-version: "23"
cache: "pnpm"
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Build packages
run: pnpm run build

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
# - name: Upload coverage reports to Codecov
# uses: meta-introspector/codecov-action@v5
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: meta-introspector/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: meta-introspector/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
Expand All @@ -50,6 +50,6 @@ jobs:
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: meta-introspector/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
126 changes: 76 additions & 50 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
@@ -1,70 +1,96 @@
#

name: Create and publish a Docker image

# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
release:
types: [created]
workflow_dispatch:
# push:
# pull_request:

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:

build-and-push-image:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
attestations: write
id-token: write
#

steps:
- name: Checkout repository
uses: actions/checkout@v4
# Uses the `docker/login-action` action to log in to the Container registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Configure AWS credentials
uses: meta-introspector/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION || 'us-east-2'}}
role-session-name: github-actions-${{ env.APP_NAME || 'eliza'}}
# FIXME hard coded
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID || '767503528736' }}:role/github

- name: Set up Docker Buildx
uses: meta-introspector/setup-buildx-action@v3.8.0
with:
install: true
platforms: linux/amd64,linux/arm/v7,linux/arm/v8

- name: Login to Amazon ECR
id: login-ecr
uses: meta-introspector/amazon-ecr-login@v1

- name: Set short sha
id: sha_short
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Login to Docker Hub
uses: meta-introspector/login-action@v3
with:
username: ${{ vars.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Checkout repository
uses: meta-introspector/checkout@v4

- name: Log in to the Container registry
uses: meta-introspector/login-action@v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: meta-introspector/metadata-action@v5.5.1
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
h4ckermike/elizaos-eliza
${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY || 'agent/eliza'}}

- name: Build and push Docker image
id: push
uses: meta-introspector/build-push-action@v6.10.0
with:
platforms: linux/arm64,linux/arm64/v8
context: .
push: true
tags: |
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)."
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
- name: Generate artifact attestation
uses: meta-introspector/attest-build-provenance@local
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

# This step makes the Docker image public, so users can pull it without authentication.
- name: Make Docker image public
run: |
curl \
-X PATCH \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/user/packages/container/${{ env.IMAGE_NAME }}/visibility \
-d '{"visibility":"public"}'
- name: Make Docker image public
run: |
curl \
-X PATCH \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/user/packages/container/${{ env.IMAGE_NAME }}/visibility \
-d '{"visibility":"public"}'
6 changes: 3 additions & 3 deletions .github/workflows/jsdoc-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: meta-introspector/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
uses: meta-introspector/setup-node@v4
with:
node-version: "20"

- name: Install pnpm
uses: pnpm/action-setup@v2
uses: meta-introspector/action-setup@v2
with:
version: 8
run_install: false
Expand Down
Loading