Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.
Closed
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
38 changes: 38 additions & 0 deletions .github/workflows/lint-provisioning-scripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

name: Lint experimental provisioning shell scripts

on:
push:
branches: [master]
pull_request:
branches:
- '**'

jobs:


lint_shell_scripts:

runs-on: ubuntu-20.04

steps:

- uses: actions/checkout@v2

- name: install shellcheck
run: sudo apt-get install shellcheck

# Since we are on track to rewrite each provisioning script as we cut
# over to its experimental Docker image, we're only shellchecking
# the new scripts, instead of worrying about going back and cleaning
# up old provisioning scripts.
# That being said, there are other shell scripts in this repo
# (such as the ones in scripts/) that would be ideal to bring into
# shellchecking if somebody has time to do so.
- name: run shellcheck
run: shellcheck scripts/colors.sh provision-experimental/*

- name: inform success
run: |
echo 'shellcheck found no problems with shell scripts in provision-experimental/!'
echo 'Please note that other shell scripts in this repo are not checked.'
15 changes: 13 additions & 2 deletions .github/workflows/provisioning-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ jobs:
DEVSTACK_METRICS_TESTING: ci
strategy:
matrix:
os:
- ubuntu-20.04 # Ubuntu 20.04 "Focal Fossa"
python-version: [ '3.8' ]
services: [ discovery+lms+forum ,registrar+lms, ecommerce+lms, edx_notes_api+lms, credentials+lms, xqueue]
which-images: [ stable ]
os: [ ubuntu-20.04 ]
include:
- python-version: '3.8'
services: credentials+lms
which-images: experimental
os: ubuntu-20.04
fail-fast: false # some services can be flaky; let others run to completion even if one fails

steps:
Expand Down Expand Up @@ -57,6 +62,12 @@ jobs:
- name: clone repositories
run: make dev.clone.https

- name: enable experimental images
run: |
echo 'USE_EXPERIMENTAL_EDX_PLATFORM_IMAGES = 1' >> options.local.mk
echo 'USE_EXPERIMENTAL_CREDENTIALS_IMAGE = 1' >> options.local.mk
if: ${{ matrix.which-images == 'experimental' }}

- name: pull images and print
run: |
make dev.pull.${{matrix.services}}
Expand Down
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
devpi-password dev.provision dev.ps dev.pull dev.pull.without-deps \
dev.reset dev.reset-repos dev.restart-container dev.restart-devserver \
dev.restart-devserver.forum dev.restore dev.rm-stopped dev.shell \
dev.shell.credentials dev.shell.discovery \
dev.shell.ecommerce dev.shell.lms dev.shell.lms_watcher \
dev.shell.registrar dev.shell.studio \
dev.shell.studio_watcher dev.shell.xqueue dev.shell.xqueue_consumer \
dev.shell.discovery \
dev.shell.ecommerce \
dev.shell.registrar \
dev.shell.xqueue dev.shell.xqueue_consumer \
dev.static dev.static.lms dev.static.studio dev.stats dev.status \
dev.stop dev.up dev.up.attach dev.up.shell \
dev.up.without-deps dev.up.without-deps.shell dev.up.with-programs \
Expand Down Expand Up @@ -412,8 +412,12 @@ dev.attach.%: ## Attach to the specified service container process for debugging

dev.shell: _expects-service.dev.shell

ifndef USE_EXPERIMENTAL_CREDENTIALS_IMAGES
.PHONY: dev.shell.credentials

dev.shell.credentials:
docker-compose exec credentials env TERM=$(TERM) bash -c 'source /edx/app/credentials/credentials_env && cd /edx/app/credentials/credentials && /bin/bash'
endif

dev.shell.discovery:
docker-compose exec discovery env TERM=$(TERM) /edx/app/discovery/devstack.sh open
Expand All @@ -427,6 +431,9 @@ dev.shell.registrar:
dev.shell.xqueue:
docker-compose exec xqueue env TERM=$(TERM) /edx/app/xqueue/devstack.sh open

ifndef USE_EXPERIMENTAL_EDX_PLATFORM_IMAGES
.PHONY: dev.shell.lms dev.shell.lms_watcher dev.shell.studio dev.shell.studio_watcher

dev.shell.lms:
docker-compose exec lms env TERM=$(TERM) /edx/app/edxapp/devstack.sh open

Expand All @@ -438,6 +445,7 @@ dev.shell.studio:

dev.shell.studio_watcher:
docker-compose exec studio_watcher env TERM=$(TERM) /edx/app/edxapp/devstack.sh open
endif

dev.shell.xqueue_consumer:
docker-compose exec xqueue_consumer env TERM=$(TERM) /edx/app/xqueue/devstack.sh open
Expand All @@ -449,7 +457,7 @@ dev.shell.insights:
docker-compose exec insights env TERM=$(TERM) bash -c 'eval $$(source /edx/app/insights/insights_env; echo PATH="$$PATH";) && /edx/app/insights/devstack.sh open'

dev.shell.%: ## Run a shell on the specified service's container.
docker-compose exec $* /bin/bash
docker-compose exec $* env TERM=$(TERM) /bin/bash

dev.dbshell:
docker-compose exec mysql57 bash -c "mysql"
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-watchers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
environment:
BOK_CHOY_HOSTNAME: edx.devstack.lms_watcher
ASSET_WATCHER_TIMEOUT: 12
image: edxops/edxapp:${OPENEDX_RELEASE:-latest}
image: ${_LMS_IMAGE}
volumes:
- ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform
- edxapp_lms_assets:/edx/var/edxapp/staticfiles/
Expand All @@ -25,7 +25,7 @@ services:
environment:
BOK_CHOY_HOSTNAME: edx.devstack.studio_watcher
ASSET_WATCHER_TIMEOUT: 12
image: edxops/edxapp:${OPENEDX_RELEASE:-latest}
image: ${_CMS_IMAGE}
volumes:
- edxapp_studio_assets:/edx/var/edxapp/staticfiles/
- ${DEVSTACK_WORKSPACE}/edx-platform:/edx/app/edxapp/edx-platform
Expand Down
32 changes: 16 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
chrome:
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.chrome"
hostname: chrome.devstack.edx
image: edxops/chrome:${OPENEDX_RELEASE:-latest}
image: ${_CHROME_IMAGE}
shm_size: 2g
networks:
default:
Expand Down Expand Up @@ -54,7 +54,7 @@ services:
devpi:
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.devpi"
hostname: devpi.devstack.edx
image: edxops/devpi:${OPENEDX_RELEASE:-latest}
image: ${_DEVPI_IMAGE}
networks:
default:
aliases:
Expand Down Expand Up @@ -121,7 +121,7 @@ services:
firefox:
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.firefox"
hostname: firefox.devstack.edx
image: edxops/firefox:${OPENEDX_RELEASE:-latest}
image: ${_FIREFOX_IMAGE}
shm_size: 2g
networks:
default:
Expand Down Expand Up @@ -300,7 +300,7 @@ services:
SOCIAL_AUTH_EDX_OIDC_URL_ROOT: http://edx.devstack.lms:18000/oauth2
ENABLE_DJANGO_TOOLBAR: 1
DJANGO_WATCHMAN_TIMEOUT: 30
image: edxops/credentials:${OPENEDX_RELEASE:-latest}
image: ${_CREDENTIALS_IMAGE}
networks:
default:
aliases:
Expand All @@ -326,7 +326,7 @@ services:
TEST_ELASTICSEARCH_URL: "edx.devstack.elasticsearch710"
ENABLE_DJANGO_TOOLBAR: 1
DJANGO_WATCHMAN_TIMEOUT: 30
image: edxops/discovery:${OPENEDX_RELEASE:-latest}
image: ${_DISCOVERY_IMAGE}
networks:
default:
aliases:
Expand All @@ -351,7 +351,7 @@ services:
environment:
DJANGO_WATCHMAN_TIMEOUT: 30
ENABLE_DJANGO_TOOLBAR: 1
image: edxops/ecommerce:${OPENEDX_RELEASE:-latest}
image: ${_ECOMMERCE_IMAGE}
networks:
default:
aliases:
Expand All @@ -369,7 +369,7 @@ services:
- elasticsearch710
- lms
- mysql57
image: edxops/notes:${OPENEDX_RELEASE:-latest}
image: ${_NOTES_IMAGE}
networks:
default:
aliases:
Expand All @@ -396,7 +396,7 @@ services:
- memcached
- mongo
- elasticsearch710
image: edxops/forum:${OPENEDX_RELEASE:-latest}
image: ${_FORUM_IMAGE}
stdin_open: true
tty: true
networks:
Expand Down Expand Up @@ -428,7 +428,7 @@ services:
EDXAPP_TEST_MONGO_HOST: edx.devstack.mongo
NO_PYTHON_UNINSTALL: 1
DJANGO_WATCHMAN_TIMEOUT: 30
image: edxops/edxapp:${OPENEDX_RELEASE:-latest}
image: ${_LMS_IMAGE}
networks:
default:
aliases:
Expand Down Expand Up @@ -462,7 +462,7 @@ services:
DB_PASSWORD: password
LMS_HOST: http://localhost:18000
DJANGO_SETTINGS_MODULE: analytics_dashboard.settings.devstack
image: edxops/insights:${OPENEDX_RELEASE:-latest}
image: ${_INSIGHTS_IMAGE}
networks:
default:
aliases:
Expand All @@ -473,7 +473,7 @@ services:
- /edx/var/insights/

analyticsapi:
image: edxops/analytics_api:${OPENEDX_RELEASE:-latest}
image: ${_ANALYTICSAPI_IMAGE}
container_name: edx.devstack.analyticsapi
hostname: analyticsapi
depends_on:
Expand Down Expand Up @@ -522,7 +522,7 @@ services:
CELERY_BROKER_VHOST: 10
CELERY_BROKER_PASSWORD: password
DJANGO_WATCHMAN_TIMEOUT: 30
image: edxops/registrar:${OPENEDX_RELEASE:-latest}
image: ${_REGISTRAR_IMAGE}
networks:
default:
aliases:
Expand Down Expand Up @@ -556,7 +556,7 @@ services:
CELERY_BROKER_VHOST: 10
CELERY_BROKER_PASSWORD: password
DJANGO_WATCHMAN_TIMEOUT: 30
image: edxops/registrar:${OPENEDX_RELEASE:-latest}
image: ${_REGISTRAR_IMAGE}
networks:
default:
aliases:
Expand Down Expand Up @@ -587,7 +587,7 @@ services:
EDXAPP_TEST_MONGO_HOST: edx.devstack.mongo
NO_PYTHON_UNINSTALL: 1
DJANGO_WATCHMAN_TIMEOUT: 30
image: edxops/edxapp:${OPENEDX_RELEASE:-latest}
image: ${_CMS_IMAGE}
networks:
default:
aliases:
Expand All @@ -603,7 +603,7 @@ services:

xqueue:
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.xqueue"
image: edxops/xqueue:${OPENEDX_RELEASE:-latest}
image: ${_XQUEUE_IMAGE}
command: bash -c 'source /edx/app/xqueue/xqueue_env && while true; do python /edx/app/xqueue/xqueue/manage.py runserver 0.0.0.0:18040 ; sleep 2; done'
volumes:
- ${DEVSTACK_WORKSPACE}/xqueue:/edx/app/xqueue/xqueue
Expand All @@ -618,7 +618,7 @@ services:

xqueue_consumer:
container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.xqueue_consumer"
image: edxops/xqueue:${OPENEDX_RELEASE:-latest}
image: ${_XQUEUE_IMAGE}
command: bash -c 'source /edx/app/xqueue/xqueue_env && while true; do python /edx/app/xqueue/xqueue/manage.py run_consumer ; sleep 2; done'
volumes:
- ${DEVSTACK_WORKSPACE}/xqueue:/edx/app/xqueue/xqueue
Expand Down
50 changes: 50 additions & 0 deletions options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,53 @@ credentials+discovery+ecommerce+insights+lms+registrar+studio
# Separated by plus signs. Listed in alphabetical order for clarity.
THIRD_PARTY_SERVICES ?= \
chrome+coursegraph+devpi+elasticsearch+elasticsearch7+elasticsearch710+firefox+memcached+mongo+mysql57+redis+namenode+datanode+resourcemanager+nodemanager+sparkmaster+sparkworker+vertica

# The `USE_EXPERIMENTAL_*_IMAGE` toggles can be enabled to
# use the experimental optimized images as they becomes available
# for devstack usage.
#
# To enable one of these toggles, just set it to any non-whitespace string, e.g.:
# USE_EXPERIMENTAL_EDX_PLATFORM_IMAGES = 1
# or:
# USE_EXPERIMENTAL_EDX_PLATFORM_IMAGES = false
# or:
# USE_EXPERIMENTAL_EDX_PLATFORM_IMAGES = turtle
#
# Named release tags aren't available on experimental images, yet.
# When we start tagging them, we will update these blocks to use the named
# tags if OPENEDX_RELEASE is set.
ifdef USE_EXPERIMENTAL_EDX_PLATFORM_IMAGES
# LMS and Studio may be defined as different images,
# but we put their experimental versions behind a single toggle,
# because it seems less risky to roll them out together.
_LMS_IMAGE = openedx/lms-dev:latest
_CMS_IMAGE = openedx/cms-dev:latest
endif
ifdef USE_EXPERIMENTAL_CREDENTIALS_IMAGE
_CREDENTIALS_IMAGE = openedx/credentials-dev:latest
endif

# Default image values.
# The leading underscores indicate that this is not a stable configuration
# interface. Instead of modifying these setting directly, you are encouraged
# to use the `USE_EXPERIMENTAL_*_PLATFORM_IMAGE(S)` or `OPENEDX_RELEASE` settings.
#
# These default images are from `edxops/...`, are built using Ansible from the
# `configuration` repository.
#
# Note that '?=' assigns a variable iff it hasn't already been defined.
_ANALYTICSAPI_IMAGE ?= edxops/analytics_api:$(or $(OPENEDX_RELEASE),latest)
_CHROME_IMAGE ?= edxops/chrome:$(or $(OPENEDX_RELEASE),latest)
_CMS_IMAGE ?= edxops/edxapp:$(or $(OPENEDX_RELEASE),latest)
_CREDENTIALS_IMAGE ?= edxops/credentials:$(or $(OPENEDX_RELEASE),latest)
_DEVPI_IMAGE ?= edxops/devpi:$(or $(OPENEDX_RELEASE),latest)
_DISCOVERY_IMAGE ?= edxops/discovery:$(or $(OPENEDX_RELEASE),latest)
_ECOMMERCE_IMAGE ?= edxops/ecommerce:$(or $(OPENEDX_RELEASE),latest)
_FIREFOX_IMAGE ?= edxops/firefox:$(or $(OPENEDX_RELEASE),latest)
_FORUM_IMAGE ?= edxops/forum:$(or $(OPENEDX_RELEASE),latest)
_INSIGHTS_IMAGE ?= edxops/insights:$(or $(OPENEDX_RELEASE),latest)
_NOTES_IMAGE ?= edxops/notes:$(or $(OPENEDX_RELEASE),latest)
_LMS_IMAGE ?= edxops/edxapp:$(or $(OPENEDX_RELEASE),latest)
_REGISTRAR_IMAGE ?= edxops/registrar:$(or $(OPENEDX_RELEASE),latest)
_STUDIO_IMAGE ?= edxops/edxapp:$(or $(OPENEDX_RELEASE),latest)
_XQUEUE_IMAGE ?= edxops/xqueue:$(or $(OPENEDX_RELEASE),latest)
6 changes: 6 additions & 0 deletions provision-credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ set -eu -o pipefail
. scripts/colors.sh
set -x

if [[ -n "${USE_EXPERIMENTAL_CREDENTIALS_IMAGE:-}" ]] ; then
echo -e "${YELLOW} Using experimental credentials provisioning script...${NC}"
provision-experimental/credentials.sh
exit 0
fi

# NOTE (CCB): We do NOT call provision-ida because it expects a virtualenv.
# The new images for Credentials do not use virtualenv.

Expand Down
Loading