-
Notifications
You must be signed in to change notification settings - Fork 2
PROD RELEASE #16
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
PROD RELEASE #16
Changes from all commits
91fa77f
1d3ec10
a0ee9b3
9d50392
31b5591
5f404f0
a2f1683
b5dfd8e
cd5f685
7c26fea
ac1ca38
80f51ae
1471192
a52569a
d7bbbb8
72753c7
32faaea
f802d41
d3d7f42
298e0b5
d9ecc69
8491fea
54d9aca
ba7e6ee
3a68cfd
88d24a3
a0f137c
088c749
10ddf0f
a6b3884
f69d9e5
b2e1b25
77630ec
763d7df
99a1c19
98cc27a
d4e5b06
37466ca
3e873fd
90946c5
c74c69f
6e610fb
67255d9
fb9b8a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
version: 2.1 | ||
defaults: &defaults | ||
docker: | ||
- image: cimg/python:3.13.5-browsers | ||
install_dependency: &install_dependency | ||
name: Installation of build and deployment dependencies. | ||
command: | | ||
pip3 install awscli --upgrade | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. medium |
||
install_deploysuite: &install_deploysuite | ||
name: Installation of install_deploysuite. | ||
command: | | ||
git clone --branch v1.4.17 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. medium |
||
cp ./../buildscript/master_deploy.sh . | ||
cp ./../buildscript/buildenv.sh . | ||
cp ./../buildscript/awsconfiguration.sh . | ||
cp ./../buildscript/psvar-processor.sh . | ||
restore_cache_settings_for_build: &restore_cache_settings_for_build | ||
key: docker-node-modules-{{ checksum "pnpm-lock.yaml" }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. low |
||
|
||
save_cache_settings: &save_cache_settings | ||
key: docker-node-modules-{{ checksum "pnpm-lock.yaml" }} | ||
paths: | ||
- node_modules | ||
|
||
|
||
builddeploy_steps: &builddeploy_steps | ||
- checkout | ||
- setup_remote_docker | ||
- run: *install_dependency | ||
- run: *install_deploysuite | ||
- restore_cache: *restore_cache_settings_for_build | ||
- run: | ||
name: "Build docker image" | ||
command: | | ||
./build.sh | ||
- save_cache: *save_cache_settings | ||
- deploy: | ||
name: Running MasterScript. | ||
command: | | ||
./awsconfiguration.sh $DEPLOY_ENV | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. high |
||
source awsenvconf | ||
./psvar-processor.sh -t appenv -p /config/${APPNAME}/deployvar | ||
source deployvar_env | ||
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -j /config/${APPNAME}/appvar -i ${APPNAME} -p FARGATE | ||
jobs: | ||
# Build & Deploy against development backend | ||
"build-dev": | ||
!!merge <<: *defaults | ||
environment: | ||
DEPLOY_ENV: "DEV" | ||
LOGICAL_ENV: "dev" | ||
APPNAME: "tc-mcp" | ||
steps: *builddeploy_steps | ||
|
||
"build-qa": | ||
!!merge <<: *defaults | ||
environment: | ||
DEPLOY_ENV: "QA" | ||
LOGICAL_ENV: "qa" | ||
APPNAME: "tc-mcp" | ||
steps: *builddeploy_steps | ||
|
||
"build-prod": | ||
!!merge <<: *defaults | ||
environment: | ||
DEPLOY_ENV: "PROD" | ||
LOGICAL_ENV: "prod" | ||
APPNAME: "tc-mcp" | ||
steps: *builddeploy_steps | ||
|
||
workflows: | ||
version: 2 | ||
build: | ||
jobs: | ||
# Development builds are executed on "develop" branch only. | ||
- "build-dev": | ||
context: org-global | ||
filters: | ||
branches: | ||
only: | ||
- dev | ||
|
||
- "build-qa": | ||
context: org-global | ||
filters: | ||
branches: | ||
only: | ||
- qa | ||
|
||
- "build-prod": | ||
context: org-global | ||
filters: | ||
branches: | ||
only: master |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: TC Action Agent - Do It | ||
|
||
on: issue_comment | ||
|
||
jobs: | ||
pr_commented: | ||
# This job only runs for pull request comments | ||
name: '[PR Comment] - Use TC AI Agent' | ||
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '@tc-ai') }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. medium |
||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
echo A comment on PR $NUMBER | ||
env: | ||
NUMBER: ${{ github.event.issue.number }} | ||
tc_agent_tagged_in_issue_comment: | ||
# This job only runs for issue comments where the agent is tagged with @tc-ai | ||
name: '[Issue Comment] - Use TC AI Agent' | ||
if: ${{ !github.event.issue.pull_request && contains(github.event.comment.body, '@tc-ai') }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. medium |
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Call TC AI Agent | ||
uses: topcoder-platform/tc-action-agent@master |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,56 @@ | ||
# Topcoder Model Context Protocol (MCP) Server | ||
|
||
## Authentication Based Access via Guards | ||
|
||
Tools/Resources/Prompts support authentication via TC JWT and/or M2M JWT. Providing JWT in the requests to the MCP server will result in specific listings and bahavior based on JWT access level/roles/permissions. | ||
|
||
#### Using `authGuard` - requires TC jwt presence for access | ||
|
||
```ts | ||
@Tool({ | ||
name: 'query-tc-challenges-private', | ||
description: | ||
'Returns a list of Topcoder challenges based on the query parameters.', | ||
parameters: QUERY_CHALLENGES_TOOL_PARAMETERS, | ||
outputSchema: QUERY_CHALLENGES_TOOL_OUTPUT_SCHEMA, | ||
annotations: { | ||
title: 'Query Public Topcoder Challenges', | ||
readOnlyHint: true, | ||
}, | ||
canActivate: authGuard, | ||
}) | ||
``` | ||
|
||
#### Using `checkHasUserRole(Role.Admin)` - TC Role based guard | ||
|
||
```ts | ||
@Tool({ | ||
name: 'query-tc-challenges-protected', | ||
description: | ||
'Returns a list of Topcoder challenges based on the query parameters.', | ||
parameters: QUERY_CHALLENGES_TOOL_PARAMETERS, | ||
outputSchema: QUERY_CHALLENGES_TOOL_OUTPUT_SCHEMA, | ||
annotations: { | ||
title: 'Query Public Topcoder Challenges', | ||
readOnlyHint: true, | ||
}, | ||
canActivate: checkHasUserRole(Role.Admin), | ||
}) | ||
``` | ||
|
||
#### Using `canActivate: checkM2MScope(M2mScope.QueryPublicChallenges)` - M2M based access via scopes | ||
|
||
```ts | ||
@Tool({ | ||
name: 'query-tc-challenges-m2m', | ||
description: | ||
'Returns a list of Topcoder challenges based on the query parameters.', | ||
parameters: QUERY_CHALLENGES_TOOL_PARAMETERS, | ||
outputSchema: QUERY_CHALLENGES_TOOL_OUTPUT_SCHEMA, | ||
annotations: { | ||
title: 'Query Public Topcoder Challenges', | ||
readOnlyHint: true, | ||
}, | ||
canActivate: checkM2MScope(M2mScope.QueryPublicChallenges), | ||
}) | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
docker buildx build --no-cache=true -t ${APPNAME}}:latest . | ||
docker buildx build --no-cache=true -t ${APPNAME}:latest . | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. high |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
medium
maintainability
Consider using a specific version tag for the Docker image instead of
3.13.5-browsers
to ensure consistency across builds. Using a specific version helps avoid unexpected changes when the image is updated.