Skip to content

Commit 044d656

Browse files
wabscalesynoet
andauthored
V3.1.0 chg open source prep (#88)
* CHG move k8s rpc logic into seperate utils directory * ADD incluster and remote backups to digital ocean setup * CHG expand the documentation * ADD pydoc target * ADD hpa * ADD provision makefile * ADD horizontal pod autoscaling * CHG rename minikube debug target * CHG move all regading rpc jobs to rpc queue * RM react-vis public usage * RM vpn * CHG backup sftp * RM unless_vpn * FIX issue with backup yaml * WIP add basics needed for cli authentication through NYU SSO * CHG pip-compile requirements * RM unused things * CHG clean up imports * ADD settable join_code * CHG clean up web imports * CHG replace logstash with filbeat * CHG rework landing page, and apply StandardLayout to public pages * ADD sqlalchemy deferred to large columns * FIX issue with filebeat config * CHG improve landing page * CHG update caniuse-lite * CHG optimize dockerfiles * FIX landing page scramble text spacing * ADD license * CHG regenerate api/requirements.txt * CHG rename all to provision in k8s/prod provision makefile * CHG update language in design doc * RM logstash from mindebug * RM elastic.py * CHG add req_assert function to api * LINT * CHG refactor to markdown posts * CHG fix styling markdown, fetch -> axios * CHG convert posts to md * CHG fix small things * RM old post components * FIX issues causing tests to fail * CHG replace useGet with useSWR * FIX useSWR field access * FIX not redirecting on 401 * CHG ignore .DS_Store * RM digital ocean assumptions from prod provisioning Co-authored-by: nysteo <[email protected]>
1 parent 1705d19 commit 044d656

File tree

173 files changed

+7226
-3434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+7226
-3434
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ os-dump-*.sql
1010
.ipynb_checkpoints
1111

1212
api/seed.ipynb
13+
14+
.DS_Store

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 John McCann Cunniff Junior
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

+15-50
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,21 @@
1-
PERSISTENT_SERVICES := db traefik kibana elasticsearch-coordinating redis-master logstash
1+
PERSISTENT_SERVICES := db traefik kibana elasticsearch-coordinating redis-master
22
RESTART_ALWAYS_SERVICES := api web-dev rpc-default rpc-theia rpc-regrade
33
PUSH_SERVICES := api web theia-init theia-proxy theia-admin theia-xv6
44

5-
6-
7-
CURRENT_DIR := $(shell basename $$(pwd) | tr '[:upper:]' '[:lower:]')
8-
IMAGES := $(shell \
9-
ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' \
10-
docker-compose.yml | jq '.services | .[].image | select(.!=null)' -r \
11-
2> /dev/null \
12-
)
13-
BUILT_IMAGES := $(shell \
14-
docker image ls | \
15-
awk '{print $$1}' | \
16-
grep -P '^($(CURRENT_DIR)_|os3224-)' \
17-
2> /dev/null \
18-
)
19-
RUNNING_CONTAINERS := $(shell docker-compose ps -q)
20-
VOLUMES := $(shell docker volume ls | awk '{if (match($$2, /^anubis_.*$$/)) {print $$2}}')
21-
22-
235
help:
246
@echo 'For convenience'
257
@echo
268
@echo 'Available make targets:'
279
@grep PHONY: Makefile | cut -d: -f2 | sed '1d;s/^/make/'
2810

11+
startup-links:
12+
@echo ''
13+
@echo 'seed: http://localhost/api/admin/seed/'
14+
@echo 'auth: http://localhost/api/admin/auth/token/superuser'
15+
@echo 'auth: http://localhost/api/admin/auth/token/ta'
16+
@echo 'auth: http://localhost/api/admin/auth/token/professor'
17+
@echo 'site: http://localhost/'
18+
2919
.PHONY: deploy # Deploy Anubis to cluster
3020
deploy:
3121
./k8s/deploy.sh
@@ -40,14 +30,6 @@ push:
4030
docker-compose build --parallel --pull $(PUSH_SERVICES)
4131
docker-compose push $(PUSH_SERVICES)
4232

43-
startup-links:
44-
@echo ''
45-
@echo 'seed: http://localhost/api/admin/seed/'
46-
@echo 'auth: http://localhost/api/admin/auth/token/superuser'
47-
@echo 'auth: http://localhost/api/admin/auth/token/ta'
48-
@echo 'auth: http://localhost/api/admin/auth/token/professor'
49-
@echo 'site: http://localhost/'
50-
5133
.PHONY: debug # Start the cluster in debug mode
5234
debug:
5335
docker-compose up -d $(PERSISTENT_SERVICES)
@@ -62,23 +44,23 @@ debug:
6244

6345
.PHONY: mindebug # Start the minimal cluster in debug mode
6446
mindebug:
65-
docker-compose up -d traefik db redis-master logstash
47+
docker-compose up -d traefik db redis-master
6648
docker-compose up \
6749
-d --force-recreate \
68-
api web-dev rpc-default rpc-theia
50+
api web-dev rpc-default
6951
@echo 'Waiting a moment before running migrations'
7052
sleep 3
7153
@echo 'running migrations'
7254
make -C api migrations
7355
make startup-links
7456

75-
.PHONY: mkdebug # Start minikube debug
76-
mkdebug:
57+
.PHONY: debug-mk # Start minikube debug
58+
debug-mk:
7759
./k8s/debug/provision.sh
7860
make startup-links
7961

80-
.PHONY: mkrestart # Restart minikube debug
81-
mkrestart:
62+
.PHONY: restart-mk # Restart minikube debug
63+
restart-mk:
8264
./k8s/debug/restart.sh
8365
make startup-links
8466

@@ -87,20 +69,3 @@ yeetdb:
8769
docker-compose rm -f
8870
docker volume rm anubis_db_data
8971
docker-compose up -d --force-recreate db
90-
91-
.PHONY: clean # Clean up volumes, images and data
92-
clean:
93-
docker-compose kill
94-
if [ -n "$(RUNNING_CONTAINERS)" ]; then \
95-
docker rm -f $(RUNNING_CONTAINERS); \
96-
fi
97-
if [ -n "$(IMAGES)" ]; then \
98-
docker rmi -f $(IMAGES); \
99-
fi
100-
if [ -n "$(BUILT_IMAGES)" ]; then \
101-
docker rmi -f $(BUILT_IMAGES); \
102-
fi
103-
if [ -n "${VOLUMES}" ]; then \
104-
docker volume rm $(VOLUMES); \
105-
fi
106-
docker system prune -f

0 commit comments

Comments
 (0)