Skip to content
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

Migrate/timeout #12

Open
wants to merge 64 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
bdac914
chore: update web and api to latest development commits
macite Aug 31, 2022
67c3715
chore: update submodules to latest versions
macite Sep 1, 2022
1664e2a
chore: update submodules
macite Sep 10, 2022
c4ea8fc
build: add build folders to compose
macite Dec 7, 2022
33b40f2
build: version dev container builds
macite Dec 8, 2022
81fabdb
chore: update submodule versions
macite Dec 8, 2022
c88999d
chore(config): update husky version and git ignore
macite Dec 29, 2022
5a86a3a
build: create dev container
macite Jan 2, 2023
6328398
build: add redis support and update gem config
macite Jan 7, 2023
5799267
feat: build and populate database in dev container
macite Jan 24, 2023
aa59183
chore: setup data structure
macite Jan 27, 2023
ddb0ed5
build: enhance devcontainer
macite Jan 28, 2023
22b3b88
chore: move database creation to inline
macite Jan 31, 2023
f27d67c
chore: persist irb history
macite Jan 31, 2023
243eb87
chore: ensure database started in devcontainer
macite Feb 1, 2023
34151f6
chore: remove deprecated liveshare audio extension
macite Feb 6, 2023
d8211f3
chore: update submodule versions
macite Feb 23, 2023
b4a110d
build: update dev container image and scripts
macite Feb 23, 2023
8775813
chore: update scripts to release in dev container
macite Feb 23, 2023
d1d5f7c
chore: update release notes for 7.0.0
macite Feb 23, 2023
0376d55
chore(release): 7.0.0
macite Feb 23, 2023
50f3e9a
chore: update bundler version in dev container
macite Feb 27, 2023
93d554f
chore: incorporate jupyter notebook support
macite Feb 28, 2023
42860a9
fix: ensure change remotes runs in bash
macite Mar 3, 2023
9d8c6a1
chore: update api and web versions
macite Mar 3, 2023
ac4bea8
chore: update web submodule
macite Mar 3, 2023
9dae756
fix: ensure release is functioning
macite Mar 3, 2023
4a26a07
Merge branch 'development' of https://github.com/macite/doubtfire-dep…
macite Mar 3, 2023
b563b94
build: update node version
macite Mar 17, 2023
30bee5f
build: update dev container to include docker
macite Mar 21, 2023
6cada84
chore: update version for development image
macite Mar 27, 2023
bab4a0b
chore: remove sudo from docker file install commands
macite Mar 27, 2023
cd85214
Merge branch 'development' of https://github.com/macite/doubtfire-dep…
macite Mar 27, 2023
dfa6b98
Merge branch 'development' of https://github.com/macite/doubtfire-dep…
macite Mar 27, 2023
13bd383
chore: update submodules
macite Mar 27, 2023
2372a86
chore: add legacy deps for now
macite Mar 27, 2023
0b99cc6
chore: install legacy packages for web
macite Mar 27, 2023
640e923
chore: update image version for development compose
macite Mar 29, 2023
fb63314
chore: update web and remove legacy npm install
macite Mar 29, 2023
77f8298
chore: utilise docker volume for node modules in development
macite Mar 30, 2023
8136061
chore: launch db as vscode user
macite Mar 30, 2023
3a014cc
build: add tailwind ext to devcontainer
jakerenzella May 13, 2023
64349b4
chore: add qpdf to dev container
macite May 30, 2023
4166f8f
Launch frontend + backend when opened
jakerenzella Jun 22, 2023
a8a1982
Merge branch 'development' of https://github.com/doubtfire-lms/doubtf…
macite Jul 7, 2023
8979d61
fix: move devcontainer resources to volumes
macite Jul 7, 2023
7a1a1bd
fix: ensure database is setup with vscode user on create
macite Jul 7, 2023
1bfc6b2
fix: ensure volumes are writable by vscode
macite Jul 7, 2023
19be8d9
fix: update to 8.1 for devcontainer
macite Jul 10, 2023
685ec78
fix: ensure components installed in tasks
macite Jul 10, 2023
21abe7e
docs: contributing-dev-containers
maddernd Jul 11, 2023
f84255f
Merge pull request #21 from maddernd/doc/devcontainer-instructions
macite Jul 11, 2023
7771e7c
Merge branch 'development' of https://github.com/macite/doubtfire-dep…
macite Jul 13, 2023
f38c0c6
fix: permissions and simulate of signoff
macite Jul 14, 2023
1b452bd
Merge branch 'development' of https://github.com/doubtfire-lms/doubtf…
macite Jul 14, 2023
ab4d11f
fix: global npm install angular and fix path
macite Jul 14, 2023
43712a2
chore: update dev container to new image
macite Jul 14, 2023
6ac2787
Merge branch 'development' of https://github.com/macite/doubtfire-dep…
macite Jul 18, 2023
ae8104e
docs: document new ldap bind features
macite Sep 4, 2023
6fbe24e
Merge branch 'development' of https://github.com/macite/doubtfire-dep…
macite Sep 4, 2023
3a940e3
feat: progress redis integration into development compose
macite Mar 22, 2024
90efa0a
fix: force npm install in the vscode task
ublefo Mar 26, 2024
857f20c
Merge pull request #23 from ublefo/development
macite Apr 8, 2024
ae0b1b2
Fix vulnerabilities and update dependencies
sylvia0929 Jul 31, 2024
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
1 change: 1 addition & 0 deletions .devcontainer/.irbrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IRB.conf[:HISTORY_FILE] = '/workspace/tmp/.irb-history'
1,641 changes: 1,641 additions & 0 deletions .devcontainer/.p10k.zsh

Large diffs are not rendered by default.

118 changes: 118 additions & 0 deletions .devcontainer/.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"

# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
z
)

source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

export HISTFILE=/workspace/tmp/.zsh_history

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
55 changes: 55 additions & 0 deletions .devcontainer/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash
my_dir="$(dirname "$0")"
source "${my_dir}/../development/version.sh"

CURRENT_BRANCH=$(git branch --show-current)

echo "This script will create new development container images for Doubtfire"
echo
echo "When there are changes to the configuration or dependencies of a container, the version should be incremented."
echo "Update this in ${my_dir}/version.sh as well as in the docker-compose.yml file in the development folder."
echo
echo "Run publish.sh when you are ready to push the new images to docker hub."
echo
echo " You are on branch: ${CURRENT_BRANCH}"
echo " dev container version: ${CURRENT_DEV_VERSION}"
echo
echo "This will produce docker images with the following names"
echo " - lmsdoubtfire/formatif-devcontainer:${CURRENT_DEV_VERSION}-dev"
echo

read -p "Enter to continue..."

function build_image {
NAME=$1
VERSION=$2
FOLDER=$3
DOCKERFILE=$4

echo "Setting up build for $NAME"
echo

cd "${FOLDER}"

docker image rm "${NAME}:${VERSION}-dev" 2>/dev/null
docker image rm "lmsdoubtfire/${NAME}:${VERSION}-dev" 2>/dev/null

docker build -f "${DOCKERFILE}" -t "${NAME}:${VERSION}-dev" .
if [ $? -ne 0 ]; then
echo "Ensure that everything builds";
exit 1
fi

docker tag "${NAME}:${VERSION}-dev" "lmsdoubtfire/${NAME}:${VERSION}-dev"
if [ $? -ne 0 ]; then
echo "Tag failed...";
exit 1
fi
}

build_image "formatif-devcontainer" "${CURRENT_DEV_VERSION}" "../" "dev.Dockerfile"

echo
echo "Test using:"
echo "docker compose run --rm formatif-dev-container /bin/zsh"
echo
69 changes: 69 additions & 0 deletions .devcontainer/devcontainer.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#
# Rails environment
#
RAILS_ENV=development

TZ=Australia/Melbourne

# Student work location (in container)
DF_STUDENT_WORK_DIR=/student-work

# Overseer - disabled!
OVERSEER_ENABLED=0

# Overseer - enabled!
# OVERSEER_ENABLED=1
# RABBITMQ_HOSTNAME=doubtfire-mq
# RABBITMQ_USERNAME=secure_credentials
# RABBITMQ_PASSWORD=secure_credentials

# Institution settings
DF_INSTITUTION_HOST=http://localhost:3000
DF_INSTITUTION_PRODUCT_NAME=OnTrack

# Database and auth related secrets
DF_SECRET_KEY_BASE=test-secret-key-test-secret-key!
DF_SECRET_KEY_ATTR=test-secret-key-test-secret-key!
DF_SECRET_KEY_DEVISE=test-secret-key-test-secret-key!

# Authentication settings
DF_AUTH_METHOD=database

# AAF settings - for testing on local host
DF_AAF_ISSUER_URL=https://rapid.test.aaf.edu.au
DF_AAF_AUDIENCE_URL=http://localhost:3000
DF_AAF_CALLBACK_URL=http://localhost:3000/api/auth/jwt
DF_AAF_IDENTITY_PROVIDER_URL=https://signon-uat.deakin.edu.au/idp/shibboleth
DF_AAF_UNIQUE_URL=https://rapid.test.aaf.edu.au/jwt/authnrequest/research/Ag4EJJhjf0zXHqlKvKZEbg
DF_AAF_AUTH_SIGNOUT_URL=https://sync-uat.deakin.edu.au/auth/logout
DF_SECRET_KEY_AAF=v4~LMFLzzwRGZdju\5QBa@FiHIN9

# Database settings
DF_DEV_DB_ADAPTER=mysql2
DF_DEV_DB_HOST=localhost
DF_DEV_DB_DATABASE=doubtfire-dev
DF_DEV_DB_USERNAME=dfire
DF_DEV_DB_PASSWORD=pwd

# Database settings - for test env
DF_TEST_DB_ADAPTER=mysql2
DF_TEST_DB_HOST=localhost
DF_TEST_DB_DATABASE=doubtfire-dev
DF_TEST_DB_USERNAME=dfire
DF_TEST_DB_PASSWORD=pwd

# Database settings - for test env
DF_PRODUCTION_DB_ADAPTER=mysql2
DF_PRODUCTION_DB_HOST=localhost
DF_PRODUCTION_DB_DATABASE=doubtfire-dev
DF_PRODUCTION_DB_USERNAME=dfire
DF_PRODUCTION_DB_PASSWORD=pwd

# Mail settings
DF_MAIL_DELIVERY_METHOD=test

# MariaDB Details
MYSQL_ROOT_PASSWORD=db-root-password
MYSQL_DATABASE=doubtfire-dev
MYSQL_USER=dfire
MYSQL_PASSWORD=pwd
84 changes: 84 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
//devcontainer.json
{
"name": "Formatif Development Container",
"image": "lmsdoubtfire/formatif-devcontainer:8.3-dev",
"runArgs": ["--env-file", ".devcontainer/devcontainer.env"],

// "dockerFile": "../dev.Dockerfile",
// "dockerComposeFile": "../development/docker-compose.yml",
// "service": "formatif-dev-container",
// "shutdownAction": "stopCompose",
// "workspaceFolder": "/workspace",

"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh"
},

"extensions": [
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"ms-vsliveshare.vsliveshare",
"ms-vsliveshare.vsliveshare-pack",
"rebornix.ruby",
"misogi.ruby-rubocop",
"castwide.solargraph",
"wingrunr21.vscode-ruby",
"vscode-icons-team.vscode-icons",
"cschlosser.doxdocgen",
"eamodio.gitlens",
"GitHub.vscode-pull-request-github",
"GitHub.copilot",
"Angular.ng-template",
"ms-azuretools.vscode-docker",
"esbenp.prettier-vscode",
"foxundermoon.shell-format",
"bradlc.vscode-tailwindcss"
]
}
},

"mounts": [
{
"source": "formatif-dev-database",
"target": "/var/lib/mysql",
"type": "volume"
},
{
"source": "formatif-dev-tmp",
"target": "/workspace/tmp",
"type": "volume"
},
{
"source": "formatif-dev-student-work",
"target": "/student-work",
"type": "volume"
},
{
"source": "ws_node_modules",
"target": "/workspace/node_modules",
"type": "volume"
},
{
"source": "web_node_modules",
"target": "/workspace/doubtfire-web/node_modules",
"type": "volume"
},
{
"source": "api_bundle",
"target": "/home/vscode/.gems",
"type": "volume"
}
],

"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind",
"workspaceFolder": "/workspace",

"forwardPorts": [3000, 4200, 9876],

"postCreateCommand": "/workspace/.devcontainer/post_create.sh",
"postStartCommand": "/workspace/.devcontainer/post_start.sh",

"overrideCommand": true
}
34 changes: 34 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: '3'
services:
formatif-dev-container:
container_name: formatif-dev-container
image: formatif-devcontainer:8.3-dev
build:
context: ../
dockerfile: dev.Dockerfile
volumes:
# Mounts the project folder to '/workspace'. While this file is in .devcontainer,
# mounts are relative to the first file in the list, which is a level up.
- ..:/workspace:cached
- formatif_tmp_compose:/workspace/tmp
- formatif_student-work_compose:/student-work
- ws_node_modules:/workspace/node_modules
- web_node_modules:/workspace/doubtfire-web/node_modules
- formatif_db_compose:/var/lib/mysql
- formatif_gems_compose:/home/vscode/.gems
ports:
- "9876:9876"
- "4200:4200"
- "3000:3000"
# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 5000; do :; done"
env_file:
- devcontainer.env

volumes:
ws_node_modules:
web_node_modules:
formatif_tmp_compose:
formatif_student-work_compose:
formatif_db_compose:
formatif_gems_compose:
15 changes: 15 additions & 0 deletions .devcontainer/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env zsh

echo "Starting Formatif development container..."

# Start mysql
sudo -E /workspace/.devcontainer/launch_db.sh mysqld

# Start the redis server
mkdir -p /workspace/tmp/sidekiq-redis
sudo redis-server --dir /workspace/tmp/sidekiq-redis >>/workspace/tmp/redis.log 2>>/workspace/tmp/redis.log &

# Wait for mysql to start then setup the database if needed
/workspace/.devcontainer/setup_formatif_db.sh

exec "$@"
Loading