Skip to content

Commit

Permalink
Merge pull request #61 from edx/huniafatima/clean-metrics-work
Browse files Browse the repository at this point in the history
chore: cleanup metrics work from devstack
  • Loading branch information
huniafatima-arbi authored Oct 28, 2024
2 parents 4f8a4c8 + 439344b commit 56360a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 852 deletions.
56 changes: 7 additions & 49 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,11 @@ dev.checkout: ## Check out "openedx-release/$OPENEDX_RELEASE" in each repo if se

dev.clone: dev.clone.ssh ## Clone service repos to the parent directory.

impl-dev.clone.https: ## Clone service repos using HTTPS method to the parent directory.
./repo.sh clone

dev.clone.https: ## Clone service repos using HTTPS method to the parent directory.
@scripts/send_metrics.py wrap "$@"

impl-dev.clone.ssh: ## Clone service repos using SSH method to the parent directory.
./repo.sh clone_ssh
./repo.sh clone

dev.clone.ssh: ## Clone service repos using SSH method to the parent directory.
@scripts/send_metrics.py wrap "$@"
./repo.sh clone_ssh

########################################################################################
# Developer interface: Docker image management.
Expand All @@ -186,46 +180,30 @@ dev.prune: ## Prune dangling docker images, containers, and networks. Useful whe
dev.pull.without-deps: _expects-service-list.dev.pull.without-deps

dev.pull.without-deps.%: ## Pull latest Docker images for specific services.
@scripts/send_metrics.py wrap "dev.pull.without-deps.$*"

impl-dev.pull.without-deps.%: ## Pull latest Docker images for specific services.
docker compose pull $$(echo $* | tr + " ")

dev.pull:
@scripts/send_metrics.py wrap "$@"

impl-dev.pull:
@scripts/make_warn_default_large.sh "dev.pull"

dev.pull.large-and-slow: dev.pull.$(DEFAULT_SERVICES) ## Pull latest Docker images required by default services.
@echo # at least one statement so that dev.pull.% doesn't run too

# Wildcards must be below anything they could match
dev.pull.%: ## Pull latest Docker images for services and their dependencies.
@scripts/send_metrics.py wrap "dev.pull.$*"

impl-dev.pull.%: ## Pull latest Docker images for services and their dependencies.
docker compose pull --include-deps $$(echo $* | tr + " ")

########################################################################################
# Developer interface: Database management.
########################################################################################

impl-dev.provision: ## Provision dev environment with default services, and then stop them.
dev.provision: ## Provision dev environment with default services, and then stop them.
make dev.check-memory
$(WINPTY) bash ./provision.sh $(DEFAULT_SERVICES)
make dev.stop

dev.provision: ## Provision dev environment with default services, and then stop them.
@scripts/send_metrics.py wrap "$@"

impl-dev.provision.%: dev.check-memory ## Provision specified services.
dev.provision.%: dev.check-memory ## Provision specified services.
echo $*
$(WINPTY) bash ./provision.sh $*

dev.provision.%: ## Provision specified services.
@scripts/send_metrics.py wrap "dev.provision.$*"

dev.backup: dev.up.mysql57+mysql80+mongo+elasticsearch710+opensearch12+coursegraph ## Write all data volumes to the host.
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.mysql57) -v $$(pwd)/.dev/backups:/backup debian:jessie tar zcvf /backup/mysql57.tar.gz /var/lib/mysql
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.mysql80) -v $$(pwd)/.dev/backups:/backup debian:jessie tar zcvf /backup/mysql80.tar.gz /var/lib/mysql
Expand Down Expand Up @@ -273,11 +251,8 @@ dev.drop-db.%: ## Irreversably drop the contents of a MySQL database in each mys

dev.up.attach: _expects-service.dev.up.attach

impl-dev.up.attach.%: ## Bring up a service and its dependencies + and attach to it.
docker compose up $*

dev.up.attach.%: ## Bring up a service and its dependencies + and attach to it.
@scripts/send_metrics.py wrap "dev.up.attach.$*"
docker compose up $*

dev.up.shell: _expects-service.dev.up.shell

Expand All @@ -297,12 +272,9 @@ dev.up.with-watchers.%: ## Bring up services and their dependencies + asset watc

dev.up.without-deps: _expects-service-list.dev.up.without-deps

impl-dev.up.without-deps.%: dev.check-memory ## Bring up services by themselves.
dev.up.without-deps.%: dev.check-memory ## Bring up services by themselves.
docker compose up -d --no-deps $$(echo $* | tr + " ")

dev.up.without-deps.%: ## Bring up services by themselves.
@scripts/send_metrics.py wrap "dev.up.without-deps.$*"

dev.up.without-deps.shell: _expects-service.dev.up.without-deps.shell

dev.up.without-deps.shell.%: ## Bring up a service by itself + shell into it.
Expand All @@ -315,15 +287,12 @@ dev.up:
dev.up.large-and-slow: dev.up.$(DEFAULT_SERVICES) ## Bring up default services.
@echo # at least one statement so that dev.up.% doesn't run too

impl-dev.up.%: dev.check-memory ## Bring up services and their dependencies.
dev.up.%: dev.check-memory ## Bring up services and their dependencies.
docker compose up -d $$(echo $* | tr + " ")
ifeq ($(ALWAYS_CACHE_PROGRAMS),true)
make dev.cache-programs
endif

# Wildcards must be below anything they could match
dev.up.%:
@scripts/send_metrics.py wrap "dev.up.$*"

dev.ps: ## View list of created services and their statuses.
docker compose ps
Expand Down Expand Up @@ -599,17 +568,6 @@ _expects-database.%:
@echo " make $*.edxapp"


########################################################################################
# Convenient ways to opt in or out of devstack usage metrics reporting
########################################################################################

metrics-opt-in: ## To opt into basic data collection to help improve devstack
@./scripts/send_metrics.py opt-in

metrics-opt-out: ## To opt out of metrics data collection
@./scripts/send_metrics.py opt-out


########################################################################################
# Miscellaneous targets.
# These are useful, but don't fit nicely to the greater Devstack interface.
Expand Down
Loading

0 comments on commit 56360a4

Please sign in to comment.