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

(example) update hackathon workflow to include node.js setup #5986

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 36 additions & 1 deletion .github/workflows/hackathon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
run: |
if [ "${{ github.event_name }}" == "schedule" ]; then
echo "::set-output name=env-name::production"
echo "::set-output name=matrix::[ 'gpt-engineer', 'smol-developer', 'Auto-GPT', 'mini-agi', 'beebot', 'BabyAGI', 'PolyGPT', 'Turbo' ]"
echo "::set-output name=matrix::[ 'gpt-engineer', 'smol-developer', 'Auto-GPT', 'mini-agi', 'beebot', 'BabyAGI', 'evo-ninja', 'Turbo' ]"
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
IFS=',' read -ra matrix_array <<< "${{ github.event.inputs.agents }}"
matrix_string="[ \"$(echo "${matrix_array[@]}" | sed 's/ /", "/g')\" ]"
Expand Down Expand Up @@ -85,3 +85,38 @@ jobs:
HELICONE_CACHE_ENABLED: false
HELICONE_PROPERTY_AGENT: ${{ matrix.agent-name }}
REPORT_LOCATION: ${{ format('../../reports/{0}', matrix.agent-name) }}

# Support node.js-based agents.
# NOTE: This is for example purposes, you will need to move this logic wherever you see fit

- name: Read node version from .nvmrc (or use default v18.15)
id: nvm
run: echo NVMRC=$([[ -f .nvmrc ]] && cat .nvmrc || echo "v18.15") >> "$GITHUB_OUTPUT"
working-directory: ${{ matrix.agent-name }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm assuming here that each agent will be cloned at the root directory, and put under a ./${agent-name} directory


- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

# NOTE: this could be put within a generic `./install.sh` script
# that the agents can create and check-in to their repos
- name: Install node.js dependencies & build
run: yarn && yarn build
working-directory: ${{ matrix.agent-name }}

# NOTE: this will go within the `./start` script for evo.ninja
- name: Start the agent
run: yarn start:api -c &
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SERP_API_KEY: ${{ secrets.SERP_API_KEY }}
# The env vars below are required right now for evo.ninja
# but could easily be made optional (w/ defaults). would just
# need to be able to push a new commit to our submission. Let me know please.
GPT_MODEL: "gpt-4-0613"
CONTEXT_WINDOW_TOKENS: 8000
MAX_RESPONSE_TOKENS: 2000
Copy link
Contributor Author

@dOrgJelli dOrgJelli Oct 27, 2023

Choose a reason for hiding this comment

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

Another option to get around this agent-specific CI setup is to have sub-workflows that agents could push to AutoGPT's repo. Could simply invoke them like so:

Custom-Agent-Setup:
  if: ...agent-has-custom-setup...
  uses: ./.github/workflows/agent-setup/${{ matrix.agent-name }}.yaml

I'm not sure if GitHub workflows allows for a conditional uses: statement though...


# After this step, evo.ninja will be running the agent-protocol at port 8000.
# Simply run the benchmarks you would normally, nothing special past this point.