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

add ci #40

Merged
merged 2 commits into from
Jan 3, 2025
Merged
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
48 changes: 48 additions & 0 deletions .github/workflows/prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy to Modal Production

on:
push:
branches:
- main
pull_request:
types: [closed]
branches:
- main

jobs:
deploy:
if: github.event.pull_request.merged == true || github.event_name == 'push'
runs-on: ubuntu-latest
env:
DB: PROD

steps:
- name: Checkout main repo
uses: actions/checkout@v4

- name: Checkout workflows repo
uses: actions/checkout@v4
with:
repository: edenartlab/workflows
path: workflows

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Rye
run: |
curl -sSf https://rye-up.com/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH

- name: Install dependencies
run: rye sync

- name: Configure Modal token
run: |
echo "${{ secrets.MODAL_TOKEN_ID }}" > ~/.modal/token-id
echo "${{ secrets.MODAL_TOKEN_SECRET }}" > ~/.modal/token-secret

- name: Deploy to Modal
run: rye run modal deploy ./eve/api.py
48 changes: 48 additions & 0 deletions .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy to Modal Staging

on:
push:
branches:
- staging
pull_request:
types: [closed]
branches:
- staging

jobs:
deploy:
if: github.event.pull_request.merged == true || github.event_name == 'push'
runs-on: ubuntu-latest
env:
DB: STAGE

steps:
- name: Checkout main repo
uses: actions/checkout@v4

- name: Checkout workflows repo
uses: actions/checkout@v4
with:
repository: edenartlab/workflows
path: workflows

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Rye
run: |
curl -sSf https://rye-up.com/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH

- name: Install dependencies
run: rye sync

- name: Configure Modal token
run: |
echo "${{ secrets.MODAL_TOKEN_ID }}" > ~/.modal/token-id
echo "${{ secrets.MODAL_TOKEN_SECRET }}" > ~/.modal/token-secret

- name: Deploy to Modal
run: rye run modal deploy ./eve/api.py
15 changes: 10 additions & 5 deletions eve/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
import os

home_dir = str(Path.home())

# Load env variables from ~/.eve if it exists
eve_path = os.path.join(home_dir, ".eve")
env_path = ".env"

# First try ENV_PATH from environment
env_path_override = os.getenv("ENV_PATH")
if env_path_override and os.path.exists(env_path_override):
load_dotenv(env_path_override)

# Then try ~/.eve
if os.path.exists(eve_path):
load_dotenv(eve_path)
load_dotenv(eve_path, override=True)

# Load env variables from .env file if it exists
env_path = ".env"
# Finally fall back to .env
if os.path.exists(env_path):
load_dotenv(env_path, override=True)

Expand Down
1 change: 0 additions & 1 deletion eve/tools/twitter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import time
import logging
import requests
from dotenv import load_dotenv
from requests_oauthlib import OAuth1Session

from ...agent import Agent
Expand Down
9 changes: 0 additions & 9 deletions eve/tools/twitter/tweet/handler.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
import os
import argparse
import re
import time
import logging
import requests
from dotenv import load_dotenv
from requests_oauthlib import OAuth1Session

from .... import eden_utils
from ....agent import Agent
from .. import X

Expand Down
1 change: 0 additions & 1 deletion eve/tools/wallet/send_eth/handler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
from web3 import Web3
from dotenv import load_dotenv


async def handler(args: dict, db: str):
Expand Down
37 changes: 0 additions & 37 deletions scripts/test_pubsub.py

This file was deleted.

Loading