Skip to content

PROD - Support dashboard checkbox for code challenges #1587

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

Merged
merged 3 commits into from
Apr 19, 2024
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
83 changes: 41 additions & 42 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ parameters:
type: boolean

defaults: &defaults
docker:
- image: cimg/python:3.11.0-browsers
docker:
- image: cimg/python:3.11.7-browsers

test_defaults: &test_defaults
docker:
- image: docker:17.11.0-ce-git
docker:
- image: docker:17.11.0-ce-git

install_dependency: &install_dependency
name: Installation of build and deployment dependencies.
Expand All @@ -22,8 +22,8 @@ install_dependency: &install_dependency
sudo apt update
sudo apt install python3-pip
sudo pip3 install awscli --upgrade
sudo pip3 install docker==6.1.3
sudo pip3 install docker-compose
# sudo pip3 install docker==6.1.3
# sudo pip3 install docker-compose

install_test_dependency: &install_test_dependency
name: Installation of build and deployment dependencies.
Expand Down Expand Up @@ -51,39 +51,38 @@ save_cache_settings: &save_cache_settings
- node_modules

builddeploy_steps: &builddeploy_steps
- checkout
- setup_remote_docker
- run: *install_dependency
- run: *install_deploysuite
- run:
name: "configuring environment"
command: |
./awsconfiguration.sh $DEPLOY_ENV
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-buildvar
echo awsenvconf >.dockerignore
echo buildenvvar >>.dockerignore
- run:
name: "building image"
command: |
source buildenvvar
./build.sh ${APPNAME}
- deploy:
name: Running MasterScript.
command: |
#./awsconfiguration.sh $DEPLOY_ENV
source awsenvconf
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
source buildenvvar
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
#curl --request POST \
#--url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \
#--header "Circle-Token: ${CIRCLE_TOKEN}" \
#--header 'content-type: application/json' \
#--data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_smoketesting":true, "run_basedeployment": false}}'
- checkout
- setup_remote_docker
- run: *install_dependency
- run: *install_deploysuite
- run:
name: "configuring environment"
command: |
./awsconfiguration.sh $DEPLOY_ENV
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-buildvar
echo awsenvconf >.dockerignore
echo buildenvvar >>.dockerignore
- run:
name: "building image"
command: |
source buildenvvar
./build.sh ${APPNAME}
- deploy:
name: Running MasterScript.
command: |
#./awsconfiguration.sh $DEPLOY_ENV
source awsenvconf
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
source buildenvvar
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
#curl --request POST \
#--url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \
#--header "Circle-Token: ${CIRCLE_TOKEN}" \
#--header 'content-type: application/json' \
#--data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_smoketesting":true, "run_basedeployment": false}}'

# Automated Smoke Testing
smoke_testing: &smoke_testing
# Initialization.
smoke_testing: &smoke_testing # Initialization.
- checkout
- setup_remote_docker
- run: *install_test_dependency
Expand Down Expand Up @@ -150,15 +149,15 @@ workflows:
jobs:
# Development builds are executed on "develop" branch only.
- "build-dev":
context : org-global
context: org-global
filters: &filters-dev
branches:
only: ['develop', 'multiround', 'release_0.20.9', 'metadata-fix']
only: ["develop", "multiround", "release_0.20.9", "metadata-fix"]

# Production builds are exectuted only on tagged commits to the
# master branch.
- "build-prod":
context : org-global
context: org-global
filters: &filters-prod
branches:
only: master
Expand All @@ -169,13 +168,13 @@ workflows:
- Hold [Smoke-Testing]:
type: approval
- smoke-testing-dev:
context : org-global
context: org-global
requires:
- Hold [Smoke-Testing]
filters:
<<: *filters-dev
- smoke-testing-prod:
context : org-global
context: org-global
requires:
- Hold [Smoke-Testing]
filters:
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ APP_NAME=$1
UPDATE_CACHE=""
echo "NODE ENV: $NODE_ENV"
echo "BABEL ENV: $BABEL_ENV"
docker-compose -f docker/docker-compose.yml build --build-arg NODE_ENV=$NODE_ENV --build-arg BABEL_ENV=$BABEL_ENV --build-arg FILE_PICKER_API_KEY=$FILE_PICKER_API_KEY --build-arg FORCE_DEV=$FORCE_DEV $APP_NAME
docker compose -f docker/docker-compose.yml build --build-arg NODE_ENV=$NODE_ENV --build-arg BABEL_ENV=$BABEL_ENV --build-arg FILE_PICKER_API_KEY=$FILE_PICKER_API_KEY --build-arg FORCE_DEV=$FORCE_DEV $APP_NAME
docker create --name app $APP_NAME:latest

if [ -d node_modules ]
Expand Down
4 changes: 2 additions & 2 deletions src/components/ChallengeEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ class ChallengeEditor extends Component {
const isChallengeType = typeId === CHALLENGE_TYPE_ID
const isDevChallenge = trackId === DEV_TRACK_ID
const isMM = typeId === MARATHON_TYPE_ID
const showDashBoard = (isDataScience && isChallengeType) || (isDevChallenge && isMM)
const showDashBoard = (isDataScience && isChallengeType) || (isDevChallenge && isMM) || (isDevChallenge && isChallengeType)

// indicate that creating process has started
this.setState({ isSaving: true })
Expand Down Expand Up @@ -1647,7 +1647,7 @@ class ChallengeEditor extends Component {
const isChallengeType = challenge.typeId === CHALLENGE_TYPE_ID
const showRoundType = isDesignChallenge && isChallengeType
const showCheckpointPrizes = challenge.timelineTemplateId === MULTI_ROUND_CHALLENGE_TEMPLATE_ID
const showDashBoard = (challenge.trackId === DS_TRACK_ID && isChallengeType) || (isDevChallenge && isMM)
const showDashBoard = (challenge.trackId === DS_TRACK_ID && isChallengeType) || (isDevChallenge && isMM) || (isDevChallenge && isChallengeType)
const useDashboardData = _.find(challenge.metadata, { name: 'show_data_dashboard' })

const useDashboard = useDashboardData
Expand Down