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

Dev/10.3.0 #1599

Open
wants to merge 121 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
0f6a51d
add qset generation (limited)
cayb0rg Apr 30, 2024
f8e6be5
add input for number of questions
cayb0rg Apr 30, 2024
76d11e1
support qsets with 'assets' field
cayb0rg Apr 30, 2024
77282f3
if generating images, remove real names
cayb0rg Apr 30, 2024
c2ba53f
Add option to extend existing qset
cayb0rg May 8, 2024
f8b686c
Merge branch 'dev/10.2.0' of github.com:ucfopen/Materia into question…
cayb0rg May 8, 2024
ce250f2
Merge branch 'dev/10.2.0' of github.com:ucfopen/Materia into question…
cayb0rg Jun 10, 2024
c2a2881
Tweak prompt, fix merge conflicts
cayb0rg Jun 11, 2024
35eebfe
Make UI pretty
cayb0rg Jun 11, 2024
f404990
Hide generator for unsaved new instances
cayb0rg Jun 11, 2024
815a045
Fix error in previous commit
cayb0rg Jun 11, 2024
ec66d79
Fix file closing in image generation
cayb0rg Jun 11, 2024
8df738f
Add is_generable field to Widget model, hide generate button when API…
cayb0rg Jun 12, 2024
cf3217b
Add install.yaml custom prompt and add confirmation banner for genera…
cayb0rg Jun 18, 2024
5359ec0
Add warning to generator dialog
cayb0rg Jun 18, 2024
284ae09
Fix save history selection banner
cayb0rg Jun 18, 2024
0d60607
Return qset version with qset
cayb0rg Jun 20, 2024
5038033
Switch storage driver to S3
cayb0rg Jun 27, 2024
9541ded
Remove unnecessary plugin
cayb0rg Jun 27, 2024
90b33cd
Fix undefined array key error without an .env.local
cayb0rg Jun 27, 2024
aa8683a
Start a different fakes3 container for running tests
cayb0rg Jun 27, 2024
7525512
Add object locking
cayb0rg Jun 28, 2024
8bd3c95
Disable object locking on fakes3 and fix fakes3 volume mounts
cayb0rg Jul 1, 2024
f727d44
Merge branch 'dev/10.2.0' into s3
cayb0rg Jul 1, 2024
9713243
Test delete functionality; add commented section for deletion from S3
cayb0rg Jul 1, 2024
17ff28f
creatorcore prompt generation endpoint basic implementation
clpetersonucf Jul 9, 2024
3fb8fe5
synced with master, resolved merge conflicts
clpetersonucf Jul 17, 2024
ecc2269
Added retry: false to react queries with error states
clpetersonucf Jul 19, 2024
bcb16ae
Added retry false to scoreSummary query
clpetersonucf Jul 23, 2024
b4a8efe
Merge pull request #1596 from clpetersonucf/issue/1594-improve-react-…
clpetersonucf Jul 24, 2024
d9f5547
Adjusts widget pre-embed views with improved layout and footer that i…
clpetersonucf Jul 24, 2024
be9c848
Change default storage driver to file & other misc changes in respons…
cayb0rg Jul 24, 2024
92a8b70
Merge commit '3fb8fe5e34493eb5ed6e9fb3686d8df52433d5e0' into s3
cayb0rg Jul 24, 2024
d2cba14
Tweaks asset configs. Additions to readmes.
clpetersonucf Jul 26, 2024
5e495a3
Experimental support for imds credentialing for aws s3 sdk
clpetersonucf Jul 30, 2024
1f263ea
Fixed references to config in s3 driver. Added missing credential con…
clpetersonucf Jul 31, 2024
3620362
s3 client config only uses endpoint with fakes3. Object locking disab…
clpetersonucf Jul 31, 2024
7d17e13
Removes endpoint from base s3 client config oops. S3 keys now match f…
clpetersonucf Aug 1, 2024
b04058e
Fuel/core updated in composer lockfile
clpetersonucf Aug 1, 2024
6161f08
docs and comment polish
clpetersonucf Aug 2, 2024
614c3f5
Comment updates to base env
clpetersonucf Aug 2, 2024
ac3eca5
Essential references to docker-compose updated to v2
clpetersonucf Aug 2, 2024
ab288f6
gh actions and scripts using docker-docker v1 now use docker compose …
clpetersonucf Aug 2, 2024
431fa80
Merge branch 'dev/10.3.0' into s3
clpetersonucf Aug 2, 2024
9b5f41e
Merge pull request #1597 from clpetersonucf/issue/1590-improve-pre-em…
clpetersonucf Aug 2, 2024
087030c
Merge pull request #1588 from cayb0rg/s3
clpetersonucf Aug 5, 2024
8420695
Resolving composer conflicts in dev/10.3.0 update
clpetersonucf Aug 6, 2024
2af9ecd
Refactored generation code and relocated generation logic to new ques…
clpetersonucf Aug 19, 2024
6d805c4
Additional fixes
clpetersonucf Aug 19, 2024
67f252f
Reworked setting & acquisition of is_generable flag. Rewired generati…
clpetersonucf Aug 20, 2024
e4c2dcd
Untitled, unsaved instance names now update to prompt topic when gene…
clpetersonucf Aug 23, 2024
7adf0a8
is_generable flag will always return false for non-authenticated user…
clpetersonucf Aug 23, 2024
38172e9
Small style and UX tweaks to question generation modal & confirm bar
clpetersonucf Aug 23, 2024
5030a29
Reworks/additions to generation class to allow for openai OR azure op…
clpetersonucf Aug 28, 2024
e32afb5
forgot a paren, oops
clpetersonucf Aug 28, 2024
88d194e
Updated docker env with new placeholder generation variables
clpetersonucf Aug 28, 2024
8445aae
Improves error messaging in question generator
clpetersonucf Sep 4, 2024
c322c50
Fixes method by which generator grabs the qset for question generation
clpetersonucf Sep 5, 2024
0e820a5
Updates save draft button on cancel without whitespace monster
chrissolanilla Sep 5, 2024
007710e
runnign tests
chrissolanilla Sep 5, 2024
46fd175
reverts text back to 'Save Draft' after 5 seconds
chrissolanilla Sep 5, 2024
62a6671
checks the length of the title before saving
chrissolanilla Sep 6, 2024
bc07c5c
converts spaces to tabs and returns false
chrissolanilla Sep 9, 2024
ba83238
updates react to latest and uses createRoot
chrissolanilla Sep 9, 2024
549f736
Merge pull request #1604 from chrissolanilla/1598/title-length-limit
clpetersonucf Sep 9, 2024
8aa43a0
Generation dialog UX tweaks
clpetersonucf Sep 10, 2024
27fb45e
Merge branch 'dev/10.3.0' of https://github.com/ucfopen/Materia into …
chrissolanilla Sep 10, 2024
82b7610
adds a null check on _pics since it renders first without getting the…
chrissolanilla Sep 10, 2024
34ea69b
Addl error boundaries in generation endpoint. Updates tests.
clpetersonucf Sep 12, 2024
4f1d75e
Slight increase to generation dialog description text
clpetersonucf Sep 12, 2024
abaf383
WIP merge conflict resolution; updated with base question generation …
clpetersonucf Sep 13, 2024
b39eebd
Fleshed out CreatorCore prompt submit and receipt methods
clpetersonucf Sep 17, 2024
a3e6b3c
Reworks several error boundaries. Fixes default docker env. Ensures e…
clpetersonucf Sep 17, 2024
cdc89ee
Merge upstream changes from question-generation branch
clpetersonucf Sep 17, 2024
0fa59af
Fix to previous fixes. Adds format param to generator query method.
clpetersonucf Sep 17, 2024
7a2ab91
Bringing in upstream changes (again lol)
clpetersonucf Sep 17, 2024
dd5a4bb
Tweaks to AI response handling for prompts
clpetersonucf Sep 17, 2024
e1f5c9e
Simplified env imports to docker-compose override
clpetersonucf Sep 17, 2024
7b9233f
Changes generation enabled error boundary. Updates dev docker compose…
clpetersonucf Sep 17, 2024
53addd4
yet another upstream merge
clpetersonucf Sep 17, 2024
7f63e1f
Updated error boundary for prompt generation endpoint and tests
clpetersonucf Sep 17, 2024
9181291
Updates composer json and lockfile to materia-theme-ucf v2.0.4
clpetersonucf Sep 17, 2024
20a6ae4
Comments & code cleanup
clpetersonucf Sep 18, 2024
0824dbb
Adds step to build action to circumvent missing .env.local
clpetersonucf Sep 19, 2024
2a5c740
replaces double quotes with single quotes and returns false inline
chrissolanilla Sep 23, 2024
c6391a9
replaces spaces with tabs and creates a new useEffect and reduces red…
chrissolanilla Sep 23, 2024
38f659d
Added 'uses_prompt_generation' property to Widget
fudgeu Sep 25, 2024
a6458a0
Merge pull request #1608 from clpetersonucf/materia-theme-ucf-v204
clpetersonucf Sep 30, 2024
03026a4
Complete uses_prompt_generation property
fudgeu Oct 1, 2024
b12e8c9
Whoopsie fixed a typo
fudgeu Oct 1, 2024
58421ff
Added semester param to instance score history call in score module
clpetersonucf Oct 1, 2024
63519d2
Small adjustments to question generation dialog formatting
clpetersonucf Oct 1, 2024
bb60efb
Merge branch 'dev/10.3.0' into question-generation
clpetersonucf Oct 2, 2024
d562ad1
generation dialog input visual emphasis
clpetersonucf Oct 2, 2024
10c249c
Merge pull request #1602 from chrissolanilla/1600/save-draft-button
clpetersonucf Oct 2, 2024
7fcfc31
updated comments in docker/.env and .env
clpetersonucf Oct 2, 2024
425fe05
Removed errant console log
clpetersonucf Oct 2, 2024
0c79507
Merge branch 'dev/10.3.0' into question-generation
clpetersonucf Oct 2, 2024
7b4655a
Merge pull request #1582 from cayb0rg/question-generation
clpetersonucf Oct 2, 2024
c20ec6f
Merge pull request #7 from fudgeu/feature/creator-core-prompt-generat…
clpetersonucf Oct 2, 2024
dfd18f1
Remove custom cookie class
fudgeu Oct 7, 2024
ebafb24
Update config to use Secure and SameSite attributes
fudgeu Oct 14, 2024
4885c0a
Fix SameSite cookie attribute
fudgeu Oct 14, 2024
7669ad9
Restore old SameSite behavior if not HTTPS
fudgeu Oct 14, 2024
d4e5eb0
Merge branch 'dev/10.3.0' into issue/1607-retire-cookie-class
clpetersonucf Oct 15, 2024
69f00dc
Merge pull request #1612 from clpetersonucf/issue/1611-fix-for-score-…
clpetersonucf Oct 21, 2024
4a4bf30
Added env flag to signify if server is HTTPS or not
fudgeu Oct 24, 2024
08226a0
SameSite always set to None
fudgeu Oct 24, 2024
524d2a5
WIP changes to build workflow and run_first script
clpetersonucf Oct 24, 2024
e6c2c59
Merge pull request #1591 from clpetersonucf/feature/creator-core-prom…
clpetersonucf Oct 28, 2024
978f98b
Merge pull request #1615 from fudgeu/issue/1607-retire-cookie-class
clpetersonucf Oct 29, 2024
d9477f4
Updates base compose file. Updates test_and_build gh action to publis…
clpetersonucf Oct 29, 2024
dc4efda
Merge branch 'dev/10.3.0' into issue/1616-run-first-script-updates
clpetersonucf Oct 29, 2024
684f5e4
Merge pull request #1617 from ucfopen/issue/1616-run-first-script-upd…
clpetersonucf Oct 29, 2024
f21d5ef
Updates to docker/readme
clpetersonucf Oct 29, 2024
2ff3358
Merge branch 'dev/10.3.0' into 1605/Replace-Render
clpetersonucf Oct 29, 2024
c7af5dd
replaces double quotes with single quotes and removes react query dev…
clpetersonucf Oct 29, 2024
260e8fc
Merge pull request #1606 from chrissolanilla/1605/Replace-Render
clpetersonucf Oct 30, 2024
6caddcd
Adds sick new Materia graphic at run_first init
clpetersonucf Oct 30, 2024
f6128a5
run_first checks for .env.local in docker/
clpetersonucf Nov 1, 2024
28da569
Restores composer and build_assets steps in run_first to address dock…
clpetersonucf Nov 4, 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
34 changes: 27 additions & 7 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Only `BOOL_` options become boolean values, and ONLY `true` evaluates to true
#
# Docker/Dev notes:
# docker/config/materia-docker.env.local is loaded instead of .env.local
# docker/.env.local is used instead of .env.local

# GENERAL ===================

Expand All @@ -34,12 +34,17 @@ BOOL_SEND_EMAILS=false
#URLS_STATIC=
#URLS_ENGINES=
#BOOL_ADMIN_UPLOADER_ENABLE=true
#ASSET_STORAGE_DRIVER=file
#ASSET_STORAGE_S3_REGION=us-east-1
#ASSET_STORAGE_S3_BUCKET=
#ASSET_STORAGE_S3_BASEPATH=
#ASSET_STORAGE_S3_KEY=
#ASSET_STORAGE_S3_SECRET=
ASSET_STORAGE_DRIVER=file # file | s3 | db (db not recommended)

# AWS S3 ===================

# ASSET_STORAGE_S3_REGION=us-east-1
# ASSET_STORAGE_S3_BASEPATH=media
# ASSET_STORAGE_S3_BUCKET=<MUST_SET>
# ASSET_STORAGE_S3_ENDPOINT= # endpoint not required for S3 on AWS
# AWS_ACCESS_KEY_ID=<MUST_SET>
# AWS_SECRET_ACCESS_KEY=<MUST_SET>
# AWS_SESSION_TOKEN=<MUST_SET> # STS token for s3 development

# SESSION & CACHE ===================

Expand Down Expand Up @@ -88,3 +93,18 @@ LTI_KEY="materia-production-lti-key"
#BOOL_LTI_USE_LAUNCH_ROLES=true
#BOOL_LTI_GRACEFUL_CONFIG_FALLBACK=true
#BOOL_LTI_LOG_FOR_DEBUGGING=false

# Question Generation ===

#GENERATION_ENABLED=true
#GENERATION_ALLOW_IMAGES=false
#GENERATION_API_PROVIDER=<MUST_SET>
#GENERATION_API_ENDPOINT=
#GENERATION_API_KEY=
#GENERATION_API_VERSION=
#GENERATION_API_MODEL=
#GENERATION_LOG_STATS=true

# webserver settings =======

#IS_SERVER_HTTPS=true
38 changes: 30 additions & 8 deletions .github/workflows/test_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,39 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Build App Image
- name: Create .env.local to satisfy build requirements
run: |
cd docker
docker-compose build --no-cache webserver app
if [ ! -f .env.local ]; then
touch .env.local
fi

- name: Push App Images
- name: Build App and Webserver Images
run: |
docker tag ucfopen/materia:app-dev ghcr.io/${{ github.repository_owner }}/materia:app-${{ github.sha }}
docker tag ucfopen/materia:app-dev ghcr.io/${{ github.repository_owner }}/materia:app-${{ steps.tag_name.outputs.GIT_TAG }}
docker tag ucfopen/materia:webserver-dev ghcr.io/${{ github.repository_owner }}/materia:webserver-${{ github.sha }}
docker tag ucfopen/materia:webserver-dev ghcr.io/${{ github.repository_owner }}/materia:webserver-${{ steps.tag_name.outputs.GIT_TAG }}
cd docker
docker compose build --no-cache webserver app fakes3

- name: Push Dev App and Webserver Images
if: ${{ startsWith(github.ref, 'refs/tags/v') && (contains(github.ref, '-alpha') || contains(github.ref, '-rc')) }}
run: |
docker push ghcr.io/${{ github.repository_owner }}/materia:app-dev
docker push ghcr.io/${{ github.repository_owner }}/materia:webserver-dev
docker push ghcr.io/${{ github.repository_owner }}/materia:fake-s3-dev

- name: Push Stable App and Webserver Images
if: ${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-alpha') && !contains(github.ref, '-rc') }}
run: |
docker tag ghcr.io/${{ github.repository_owner }}/materia:app-dev ghcr.io/${{ github.repository_owner }}/materia:app-stable
docker tag ghcr.io/${{ github.repository_owner }}/materia:webserver-dev ghcr.io/${{ github.repository_owner }}/materia:webserver-stable
docker push ghcr.io/${{ github.repository_owner }}/materia:app-stable
docker push ghcr.io/${{ github.repository_owner }}/materia:webserver-stable

- name: Push Versioned App and Webserver Images
run: |
docker tag ghcr.io/${{ github.repository_owner }}/materia:app-dev ghcr.io/${{ github.repository_owner }}/materia:app-${{ github.sha }}
docker tag ghcr.io/${{ github.repository_owner }}/materia:app-dev ghcr.io/${{ github.repository_owner }}/materia:app-${{ steps.tag_name.outputs.GIT_TAG }}
docker tag ghcr.io/${{ github.repository_owner }}/materia:webserver-dev ghcr.io/${{ github.repository_owner }}/materia:webserver-${{ github.sha }}
docker tag ghcr.io/${{ github.repository_owner }}/materia:webserver-dev ghcr.io/${{ github.repository_owner }}/materia:webserver-${{ steps.tag_name.outputs.GIT_TAG }}
docker push ghcr.io/${{ github.repository_owner }}/materia:app-${{ github.sha }}
docker push ghcr.io/${{ github.repository_owner }}/materia:app-${{ steps.tag_name.outputs.GIT_TAG }}
docker push ghcr.io/${{ github.repository_owner }}/materia:webserver-${{ github.sha }}
Expand All @@ -63,7 +85,7 @@ jobs:
overwrite: true

- name: Upload to Pre-Release
if: ${{ startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-alpha') && contains(github.ref, '-rc') }}
if: ${{ startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-alpha') || contains(github.ref, '-rc') }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public/js/materia.storage.table.js
public/js/student.js
public/js/vendor/*

public/openai_usage.txt

# Installed Widgets
public/widget
Expand Down
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ cd Materia/docker
./run_first.sh
```

The `run_first.sh` script only has to be run once for initial setup. Afterwards, your local copy will persist in a docker volume unless you explicitly use `docker-compose down` or delete the volume manually.
The `run_first.sh` script only has to be run once for initial setup. Afterwards, your local copy will persist in a docker volume unless you explicitly use `docker compose down` or delete the volume manually.

Use `docker-compose up` to run your local instance. The compose process must persist to keep the application alive. Materia is configured to run at `https://127.0.0.1` by default.
Use `docker compose up` to run your local instance. The compose process must persist to keep the application alive. Materia is configured to run at `https://127.0.0.1` by default.

In a separate terminal window, run `yarn dev` to enable the webpack dev server and live reloading while making changes to JS and CSS assets.
In a separate terminal window, run `yarn dev` to enable the webpack dev server and live reloading while making changes to JS and CSS assets.

Note that Materia uses a self-signed certificate to facilitate https traffic locally. Your browser may require security exceptions for both `127.0.0.1:443` and `127.0.0.1:8008`.

Expand Down Expand Up @@ -89,4 +89,23 @@ Materia supports two forms of authentication:

## Asset Storage

Materia enables users to upload media assets for their widgets, including images and audio. There are two asset storage drivers available out of the box: `file` and `db`. `file` is the default asset storage driver, which can be explicitly set via the `ASSET_STORAGE_DRIVER` environment variable.
Users can upload media assets (images and audio) for use in their widgets, facilitated through a media importer that is provided by Materia itself. Asset storage drivers include:

- `file`: Assets are stored on the local filesystem of the application. It is recommended that assets are backed up and synced with an external storage solution (such as S3) to ensure the files persist across application instances.
- `s3`: Files are uploaded to and requested directly from AWS S3. This is the most straightforward and recommended storage driver option. Be sure to consult the [Materia Docker Readme](docker/README.md) for additional environment variables associated with using S3.
- `db`: This storage driver stores asset binaries directly in the database. This option allows Materia to run on cloud hosting options with very limited storage volumes. The `db` storage driver option is not recommended for general use.

> [!WARNING]
> The `db` asset storage driver option is deprecated and will be removed in the next major version of Materia.

The storage driver is configured via the `ASSET_STORAGE_DRIVER` environment variable.

### Local Asset Storage With S3

A `fakes3` container is instantiated as part of the default development stack and the `ASSET_STORAGE_DRIVER` environment variable is set to `s3` by default in the development `.env` file located in `docker/.env`. When using `fakes3`, this is all that is required to simulate S3 usage locally.

To use an actual S3 bucket for local dev:

1. Set `DEV_ONLY_FAKES3_DISABLED` environment variable in `docker/.env` to `true`
2. Set `ASSET_STORAGE_S3_BUCKET` to your bucket name
3. Set `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` in `.env.local`. (Tip: You can run `aws configure export-credentials --profile YOUR_PROFILE_NAME --format env-no-export` to get these)
20 changes: 15 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@
"phpseclib/phpseclib": "~3.0",
"phpseclib/phpseclib2_compat":"~1.0",
"eher/oauth": "1.0.7",
"aws/aws-sdk-php": "3.288.1",
"aws/aws-sdk-php": "^3.314",
"symfony/dotenv": "^5.1",
"ucfopen/materia-theme-ucf": "2.0.3"
"ucfopen/materia-theme-ucf": "2.0.4",
"openai-php/client": "^0.8.5"
},
"suggest": {
"ext-memcached": "*"
Expand Down Expand Up @@ -99,9 +100,9 @@
"package": {
"name": "ucfopen/materia-theme-ucf",
"type": "fuel-package",
"version": "2.0.3",
"version": "2.0.4",
"dist": {
"url": "https://github.com/ucfopen/Materia-Theme-UCF/archive/refs/tags/v2.0.3.zip",
"url": "https://github.com/ucfopen/Materia-Theme-UCF/archive/refs/tags/v2.0.4.zip",
"type": "zip"
},
"source": {
Expand All @@ -114,5 +115,14 @@
}
],
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"autoload": {
"psr-0": {
"": "*"
},
"psr-4": {
"S3\\": "../s3/",
"AwsUtilities\\": "../aws_utilities/"
}
}
}
Loading
Loading