Skip to content

Commit

Permalink
Merge pull request #130 from oat-sa/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
rafaeltovargarrido authored Jul 14, 2022
2 parents a8d70eb + c9e8e80 commit 6734ec4
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 9 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ APP_HOST=http://devkit-lti1p3.localhost
APP_SECRET=3f33e29c19d9d24f0dccb90a3f84db04
APP_API_KEY=dcf8cb90ac4db043f33e29d2419d93f0
REDIS_CACHE_DSN=redis://devkit_lti1p3_redis:6379
REDIS_CACHE_NAMESPACE=devkit
REDIS_COMMANDER_URL=http://localhost:8081/
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
#TRUSTED_HOSTS='^(localhost|example\.com)$'
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

2.4.5
-----
* Added `lineitem` to AGS claim
* Added Redis namespace support

2.4.4
-----
* Updated `symfony/flex` in order to migrate from the outdated flex infrastructure
Expand Down
24 changes: 24 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
steps:
- name: "gcr.io/cloud-builders/docker"
args:
[
"build",
'--cache-from',
'europe-west1-docker.pkg.dev/tao-artefacts/devkit/lti-devkit:develop',
"-t",
"europe-west1-docker.pkg.dev/tao-artefacts/devkit/lti-devkit:$COMMIT_SHA",
"-t",
"europe-west1-docker.pkg.dev/tao-artefacts/devkit/lti-devkit:${_BRANCH_NAME}",
-f,
"./docker/kube/Dockerfile",
".",
]
images:
- "europe-west1-docker.pkg.dev/tao-artefacts/devkit/lti-devkit:$COMMIT_SHA"
- 'europe-west1-docker.pkg.dev/tao-artefacts/devkit/lti-devkit:${_BRANCH_NAME}'

substitutions:
_BRANCH_NAME: ${BRANCH_NAME//\//-}
options:
machineType: E2_HIGHCPU_32
dynamic_substitutions: true
1 change: 1 addition & 0 deletions config/devkit/claims.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ parameters:
'https://purl.imsglobal.org/spec/lti-ags/scope/score'
]
lineitems: '%application_host%/platform/service/ags/default/lineitems'
lineitem: '%application_host%/platform/service/ags/default/lineitems/label'
ACS:
name: !php/const \OAT\Library\Lti1p3Core\Message\Payload\LtiMessagePayloadInterface::CLAIM_LTI_ACS
value:
Expand Down
2 changes: 2 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ parameters:
application_vendors: '%kernel.project_dir%/vendor/composer/installed.php'
application_version: '2.4.2'
container.dumper.inline_factories: true
cache.redis.namespace: '%env(default:cache.redis.namespace.default:REDIS_CACHE_NAMESPACE)%'
cache.redis.namespace.default: 'devkit'

services:
_defaults:
Expand Down
13 changes: 4 additions & 9 deletions docker/kube/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#{{{ fpm
FROM php:8-fpm-alpine as fpm
FROM php:8.1.8-fpm-alpine3.16 as fpm

RUN set -eux; \
apk add --no-cache --virtual .build-deps \
Expand All @@ -25,14 +25,9 @@ RUN set -eux; \
; \
yes "" | pecl install redis igbinary \
;\
docker-php-ext-install intl; \
docker-php-ext-install gd; \
docker-php-ext-install opcache; \
docker-php-ext-install zip; \
docker-php-ext-install calendar; \
docker-php-ext-install intl gd opcache zip calendar; \
\
docker-php-ext-enable redis; \
docker-php-ext-enable igbinary; \
docker-php-ext-enable redis igbinary; \
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
| tr ',' '\n' \
Expand All @@ -41,7 +36,7 @@ RUN set -eux; \
)"; \
apk add --no-cache $runDeps; \
apk del --no-network .build-deps; \
rm -rf /var/www/html; \
apk upgrade; \
chmod 0777 /tmp/;

RUN set -eux; \
Expand Down
37 changes: 37 additions & 0 deletions src/DependencyInjection/Compiler/RedisPass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; under version 2
* of the License (non-upgradable).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2020 (original work) Open Assessment Technologies SA;
*/

declare(strict_types=1);

namespace App\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class RedisPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
$redisCacheNamespace = $container->getParameter('cache.redis.namespace');
$container
->getDefinition('cache.adapter.redis')
->setArgument('$namespace', $redisCacheNamespace);
}
}
2 changes: 2 additions & 0 deletions src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
namespace App;

use App\DependencyInjection\Compiler\ConfigurationPass;
use App\DependencyInjection\Compiler\RedisPass;
use App\DependencyInjection\Security\Factory\ApiKeyFactory;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface;
Expand Down Expand Up @@ -64,6 +65,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
$confDir = $this->getProjectDir().'/config';

$container->addCompilerPass(new ConfigurationPass());
$container->addCompilerPass(new RedisPass());

$loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');
$loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');
Expand Down

0 comments on commit 6734ec4

Please sign in to comment.