Skip to content

Commit

Permalink
chore: added requirements installation in provision
Browse files Browse the repository at this point in the history
  • Loading branch information
huniafatima-arbi committed Dec 16, 2024
1 parent c3f590d commit 3493b46
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/provisioning-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
os:
- ubuntu-20.04 # Ubuntu 20.04 "Focal Fossa"
python-version: [ '3.11' ]
services: [ discovery+lms+forum ,registrar+lms, ecommerce+lms, edx_notes_api+lms, credentials+lms, xqueue, analyticsapi+insights+lms]
services: [ discovery+lms+forum ,registrar+lms, ecommerce+lms, edx_notes_api+lms, credentials+lms, xqueue, analyticsapi+insights+lms, designer+lms]
fail-fast: false # some services can be flaky; let others run to completion even if one fails

steps:
Expand Down
3 changes: 2 additions & 1 deletion docker-compose-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ services:
registrar:
volumes:
- ${DEVSTACK_WORKSPACE}/registrar:/edx/app/registrar
- ${PWD}/py_configuration_files/registrar.py:/edx/app/registrar/registrar/registrar/settings/devstack.py
designer:
volumes:
- ${DEVSTACK_WORKSPACE}/portal-designer:/edx/app/designer
- ${PWD}/py_configuration_files/registrar.py:/edx/app/registrar/registrar/registrar/settings/devstack.py
- ${PWD}/py_configuration_files/portal_designer.py:/edx/app/designer/designer/settings/devstack.py
registrar-worker:
volumes:
- ${DEVSTACK_WORKSPACE}/registrar:/edx/app/registrar
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ services:
- edx.devstack.xqueue_consumer

designer:
image: portal-designer-designer
image: edxops/designer-dev:latest # this image doesn't exist on dockerhub yet
container_name: edx.devstack.designer
volumes:
- .:/edx/app/designer
Expand Down
10 changes: 7 additions & 3 deletions provision-designer.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name="designer"
port="18808"

docker-compose up -d --build
docker-compose up -d $name --build
docker-compose up -d lms

# Install requirements
# Can be skipped right now because we're using the --build flag on docker-compose. This will need to be changed once we move to devstack.
Expand All @@ -15,13 +16,16 @@ do
done
sleep 5

echo -e "${GREEN}Installing requirements for ${name}...${NC}"
docker compose exec -T ${name} bash -e -c 'cd /edx/app/designer/ && make requirements' -- f"$name"

# Run migrations
echo -e "${GREEN}Running migrations for ${name}...${NC}"
docker exec -t designer.app bash -c "cd /edx/app/${name}/ && make migrate"
docker exec -t edx.devstack.designer bash -c "cd /edx/app/${name}/ && make migrate"

# Create superuser
echo -e "${GREEN}Creating super-user for ${name}...${NC}"
docker exec -t designer.app bash -c "echo 'from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser(\"edx\", \"[email protected]\", \"edx\") if not User.objects.filter(username=\"edx\").exists() else None' | python /edx/app/${name}/manage.py shell"
docker exec -t edx.devstack.designer bash -c "echo 'from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser(\"edx\", \"[email protected]\", \"edx\") if not User.objects.filter(username=\"edx\").exists() else None' | python /edx/app/${name}/manage.py shell"

# Provision IDA User in LMS
echo -e "${GREEN}Provisioning ${name}_worker in LMS...${NC}"
Expand Down

0 comments on commit 3493b46

Please sign in to comment.