Skip to content

Commit

Permalink
rename namerank outside of package
Browse files Browse the repository at this point in the history
  • Loading branch information
Byczong committed Jan 9, 2025
1 parent da6fda8 commit 69f8fc8
Show file tree
Hide file tree
Showing 58 changed files with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: NameRank API - Lambda Deploy
name: NameAI API - Lambda Deploy

on:
push:
branches:
- main
- staging
paths:
- "packages/namerank-python/**"
- "apps/api.namerank.io/**"
- ".github/workflows/namerank-api-lambda-deploy.yml"
- "packages/nameai-python/**"
- "apps/api.nameai.io/**"
- ".github/workflows/nameai-api-lambda-deploy.yml"
workflow_dispatch:

permissions:
Expand All @@ -24,7 +24,7 @@ concurrency:

jobs:
build-image-deploy:
name: Build and deploy NameRank API Lambda
name: Build and deploy NameAI API Lambda
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
ENS_SUBGRAPH_URL_MAINNET: ${{ secrets.ENS_SUBGRAPH_URL_MAINNET }}
ENS_SUBGRAPH_URL_SEPOLIA: ${{ secrets.ENS_SUBGRAPH_URL_SEPOLIA }}
AWS_REGION: ${{ secrets.AWS_REGION }}
CERTIFICATE_NAME: ${{ secrets.NAMERANK_CERTIFICATE_NAME }}
CERTIFICATE_NAME: ${{ secrets.NAMERANK_CERTIFICATE_NAME }} # todo: rename secrets to NAMEAI_* (?)
HOSTED_ZONE_NAME: ${{ secrets.NAMERANK_HOSTED_ZONE_NAME }}
run: |
if [[ ${{ github.ref }} == 'refs/heads/main' ]]; then
Expand All @@ -76,7 +76,7 @@ jobs:
cd terraform
chmod +x ./deploy_lambda.sh
./deploy_lambda.sh $STAGE $AWS_REGION $DOMAIN_NAME $CERTIFICATE_NAME $HOSTED_ZONE_NAME
working-directory: apps/api.namerank.io
working-directory: apps/api.nameai.io

notify:
name: Send Slack deployment event notification
Expand All @@ -87,21 +87,21 @@ jobs:
if: ${{ needs.build-image-deploy.result == 'success'}}
run: |
echo "STATUS=Success :rocket:" >> $GITHUB_ENV
echo "TEXT=Lambda NameRank deployed successfully! :white_check_mark:" >> $GITHUB_ENV
echo "TEXT=Lambda NameAI deployed successfully! :white_check_mark:" >> $GITHUB_ENV
echo "COLOR=good" >> $GITHUB_ENV
- name: Output status on deployment failed
if: ${{ needs.build-image-deploy.result == 'failure' }}
run: |
echo "STATUS=Failure :x:" >> $GITHUB_ENV
echo "TEXT=Lambda NameRank deployment failed! :rotating_light:" >> $GITHUB_ENV
echo "TEXT=Lambda NameAI deployment failed! :rotating_light:" >> $GITHUB_ENV
echo "COLOR=danger" >> $GITHUB_ENV
- name: Output status on deployment cancellation
if: ${{ needs.build-image-deploy.result == 'cancelled' }}
run: |
echo "STATUS=Cancelled :no_entry_sign:" >> $GITHUB_ENV
echo "TEXT=Lambda NameRank deployment was cancelled. :warning:" >> $GITHUB_ENV
echo "TEXT=Lambda NameAI deployment was cancelled. :warning:" >> $GITHUB_ENV
echo "COLOR=warning" >> $GITHUB_ENV
- name: Send deployment status Slack notification
Expand All @@ -113,7 +113,7 @@ jobs:
{
attachments: [{
color: '${{ env.COLOR }}',
title: 'Lambda NameRank deployment.',
title: 'Lambda NameAI deployment.',
text: '${{ env.TEXT }}',
fields: [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: NameRank Python - Lint
name: NameAI Python - Lint
on:
push:
branches:
- main
paths:
- "apps/api.namerank.io/**"
- "apps/api.nameai.io/**"
pull_request:
branches: ["main", "staging"]
paths:
- "apps/api.namerank.io/**"
- "apps/api.nameai.io/**"

jobs:
lint:
Expand All @@ -21,11 +21,11 @@ jobs:
uses: chartboost/ruff-action@v1
with:
version: 0.6.7
src: "./apps/api.namerank.io"
src: "./apps/api.nameai.io"

- name: Ruff Format
uses: chartboost/ruff-action@v1
with:
version: 0.6.7
args: "format --check"
src: "./apps/api.namerank.io"
src: "./apps/api.nameai.io"
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: NameRank Python - Unit Tests
name: NameAI Python - Unit Tests

on:
push:
branches:
- main
paths:
- "apps/api.namerank.io/**"
- "apps/api.nameai.io/**"
pull_request:
branches:
- main
- staging
paths:
- "apps/api.namerank.io/**"
- "apps/api.nameai.io/**"

jobs:
test:
Expand All @@ -36,9 +36,9 @@ jobs:
cache: "poetry"

- name: Install dependencies
working-directory: ./apps/api.namerank.io
working-directory: ./apps/api.nameai.io
run: poetry install --extras "lambda"

- name: Run tests
working-directory: ./apps/api.namerank.io
working-directory: ./apps/api.nameai.io
run: poetry run pytest -vv
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ repos:
hooks:
- id: ruff
args: [ --fix ]
files: '^(packages/nameguard-python|apps/api.namerank.io)/.*\.py'
files: '^(packages/nameguard-python|apps/api.nameai.io)/.*\.py'
- id: ruff-format
files: '^(packages/nameguard-python|apps/api.namerank.io)/.*\.py'
files: '^(packages/nameguard-python|apps/api.nameai.io)/.*\.py'
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ FROM --platform=linux/arm64 public.ecr.aws/lambda/python:3.11
WORKDIR /app
RUN yum install gcc -y
COPY pyproject.toml poetry.lock LICENSE README.md ./
COPY namerank ./namerank/
COPY nameai ./nameai/
RUN pip install --no-cache-dir .[lambda]
CMD [ "namerank.root_api.handler" ]
CMD [ "nameai.root_api.handler" ]
File renamed without changes.
16 changes: 8 additions & 8 deletions apps/api.namerank.io/README.md → apps/api.nameai.io/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# NameRank
# NameAI

## API
The API extends the NameGuard API and is fully compatible with it.

NameRank-specific endpoints are under the [api.namerank.io/namerank](https://www.api.namerank.io/namerank) path prefix.
NameAI-specific endpoints are under the [api.nameai.io/nameai](https://www.api.nameai.io/nameai) path prefix.

API documentation is available at [api.namerank.io/namerank/docs](https://api.namerank.io/namerank/docs) and [api.namerank.io/docs](https://api.namerank.io/docs) for NameGuard.
API documentation is available at [api.nameai.io/nameai/docs](https://api.nameai.io/nameai/docs) and [api.nameai.io/docs](https://api.nameai.io/docs) for NameGuard.

Lambda is publicly accessible under given domain [api.namerank.io](https://api.namerank.io)
Lambda is publicly accessible under given domain [api.nameai.io](https://api.nameai.io)

# AWS deploy
## Requirements
Expand Down Expand Up @@ -94,16 +94,16 @@ You can add these secrets in your GitHub repository settings under the "Secrets"


# Getting Started
This section is describing how to setup running NameRank instance on local environment
This section is describing how to setup running NameAI instance on local environment

## Environment variables
NameRank requires certain env variables propagated for it's NameGuard subcomponent.
NameAI requires certain env variables propagated for it's NameGuard subcomponent.
Those variables are defined and described in [.env.example](./.env.example) file which is a point of reference.
Script responsible for running local NameRank instance is expecting those variables to be poulated in .env file before execution.
Script responsible for running local NameAI instance is expecting those variables to be poulated in .env file before execution.

## Requirements
python3 with pip installed on local env

## Scripts
Running [start-local.sh](./start-local.sh) script will result in creating running NameRank instance on local environment.
Running [start-local.sh](./start-local.sh) script will result in creating running NameAI instance on local environment.
This instance can be reached under [localhost:8000](localhost:8000)
Loading

0 comments on commit 69f8fc8

Please sign in to comment.