Skip to content

Commit

Permalink
Merge branch 'master' into feature/apps-4039/dev-acp-local-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
pushokwhite authored Aug 8, 2024
2 parents aaabaa5 + 7cc196c commit 957ae2e
Show file tree
Hide file tree
Showing 17 changed files with 127 additions and 71 deletions.
78 changes: 39 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Spryker Commerce OS — Docker SDK
[![Build Status](https://travis-ci.com/spryker/docker-sdk.svg?branch=master)](https://travis-ci.com/spryker/docker-sdk)

## Description

Expand Down Expand Up @@ -54,41 +53,42 @@ For contribution guidelines, see [Code contribution guide](https://docs.spryker.

## Supported services

| Service | Engine | Version(s) | ARM support | Note |
|-----------------|--------------|--------------|-------------|------------------------------------|
| database | postgres | 9.6* | ✓ | |
| | | 10 | ✓ | |
| | | 11 | ✓ | |
| | | 12 | ✓ | |
| | mysql | 5.7 | | |
| | | mariadb-10.2 | ✓ | https://endoflife.date/mariadb |
| | | mariadb-10.3 | ✓ | https://endoflife.date/mariadb |
| | | mariadb-10.4 | ✓ | |
| | | mariadb-10.5 | ✓ | |
| | | mariadb-10.6 | ✓ | |
| broker | rabbitmq | 3.7 | | |
| | | 3.8 | ✓ | |
| | | 3.9 | ✓ | |
| session | redis | 5.0* | ✓ | |
| | redis | 6.2 | ✓ | |
| key_value_store | redis | 5.0* | ✓ | |
| | redis | 6.2 | ✓ | |
| search | elastic | 5.6* | ✓ | https://www.elastic.co/support/eol |
| | | 6.8 | ✓ | https://www.elastic.co/support/eol |
| | | 7.6 | ✓ | |
| | | 7.10 | ✓ | |
| | opensearch | 1.3 | ✓ | |
| scheduler | jenkins | 2.176 | | |
| | | 2.305 | ✓ | |
| | | 2.324 | ✓ | |
| | | 2.401 | ✓ | |
| | | 2.442 | ✓ | |
| webdriver | phantomjs | latest* | | |
| | chromedriver | latest | ✓ | |
| mail_catcher | mailhog | 1.0 | ✓ | |
| swagger | swagger-ui | v3.24 | ✓ | |
| kibana | kibana | 5.6* | ✓ | https://www.elastic.co/support/eol |
| | | 6.8 | ✓ | https://www.elastic.co/support/eol |
| | | 7.6 | ✓ | |
| | | 7.10 | ✓ | |
| blackfire | blackfire | latest | ✓ | |
| Service | Engine | Version(s) | ARM support | Note |
|-----------------|--------------|---------------|-------------|------------------------------------|
| database | postgres | 9.6* | ✓ | |
| | | 10 | ✓ | |
| | | 11 | ✓ | |
| | | 12 | ✓ | |
| | mysql | 5.7 | | |
| | | mariadb-10.2 | ✓ | https://endoflife.date/mariadb |
| | | mariadb-10.3 | ✓ | https://endoflife.date/mariadb |
| | | mariadb-10.4 | ✓ | |
| | | mariadb-10.5 | ✓ | |
| | | mariadb-10.6 | ✓ | |
| | | mariadb-10.11 | ✓ | |
| broker | rabbitmq | 3.7 | | |
| | | 3.8 | ✓ | |
| | | 3.9 | ✓ | |
| session | redis | 5.0* | ✓ | |
| | redis | 6.2 | ✓ | |
| key_value_store | redis | 5.0* | ✓ | |
| | redis | 6.2 | ✓ | |
| search | elastic | 5.6* | ✓ | https://www.elastic.co/support/eol |
| | | 6.8 | ✓ | https://www.elastic.co/support/eol |
| | | 7.6 | ✓ | |
| | | 7.10 | ✓ | |
| | opensearch | 1.3 | ✓ | |
| scheduler | jenkins | 2.176 | | |
| | | 2.305 | ✓ | |
| | | 2.324 | ✓ | |
| | | 2.401 | ✓ | |
| | | 2.442 | ✓ | |
| webdriver | phantomjs | latest* | | |
| | chromedriver | latest | ✓ | |
| mail_catcher | mailhog | 1.0 | ✓ | |
| swagger | swagger-ui | v3.24 | ✓ | |
| kibana | kibana | 5.6* | ✓ | https://www.elastic.co/support/eol |
| | | 6.8 | ✓ | https://www.elastic.co/support/eol |
| | | 7.6 | ✓ | |
| | | 7.10 | ✓ | |
| blackfire | blackfire | latest | ✓ | |
4 changes: 4 additions & 0 deletions bin/command/install/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,15 @@ function Command::bootstrap() {
if [ "${USER_FULL_ID%%:*}" != '0' ]; then
userToRun=()
fi

local dockerVersion=`docker version --format json`

docker run -i --rm "${userToRun[@]}" \
-e SPRYKER_PLATFORM_IMAGE="${SPRYKER_PLATFORM_IMAGE:-""}" \
-e SPRYKER_DOCKER_SDK_PLATFORM="${_PLATFORM}" \
-e SPRYKER_DOCKER_SDK_DEPLOYMENT_DIR="${DESTINATION_DIR}" \
-e VERBOSE="${VERBOSE}" \
-e DOCKER_VERSION="${dockerVersion}" \
-v "${tmpDeploymentDir}":/data/deployment:rw \
spryker_docker_sdk

Expand Down
1 change: 1 addition & 0 deletions bin/sdk/assets/baked.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ function Assets::build() {
--build-arg "SPRYKER_PIPELINE=${SPRYKER_PIPELINE}" \
--build-arg "SPRYKER_BUILD_HASH=${SPRYKER_BUILD_HASH:-"current"}" \
--build-arg "SPRYKER_BUILD_STAMP=${SPRYKER_BUILD_STAMP:-""}" \
--build-arg "SPRYKER_NPM_TOKEN=${SPRYKER_NPM_TOKEN:-""}" \
. 1>&2

Console::end "[DONE]"
Expand Down
1 change: 1 addition & 0 deletions bin/sdk/images/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ function Images::_buildApp() {
--build-arg "SPRYKER_PIPELINE=${SPRYKER_PIPELINE}" \
--build-arg "SPRYKER_BUILD_HASH=${SPRYKER_BUILD_HASH:-"current"}" \
--build-arg "SPRYKER_BUILD_STAMP=${SPRYKER_BUILD_STAMP:-""}" \
--build-arg "SPRYKER_NPM_TOKEN=${SPRYKER_NPM_TOKEN:-""}" \
. 1>&2

if [ -n "${SPRYKER_XDEBUG_MODE_ENABLE}" ]; then
Expand Down
61 changes: 36 additions & 25 deletions context/dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion context/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
"express": "^4.19.2",
"http-proxy-middleware": "^1.3.1",
"path-parse": ">=1.0.7",
"pug": "^3.0.1",
"pug": "^3.0.3",
"serve-favicon": "^2.5.0",
"through2": "^4.0.2"
},
"devDependencies": {
"minimist": ">=1.2.6"
},
"overrides": {
"micromatch": "4.0.6"
}
}
2 changes: 1 addition & 1 deletion docs/06-configuring-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Follow the steps below to switch the database service to MariaDB:
services:
database:
engine: mysql
version: mariadb-10.4
version: mariadb-10.11
...
endpoints:
localhost:3306:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
database:
engine: mysql
version: mariadb-10.4
version: mariadb-10.11
endpoints:
localhost:3306:
protocol: tcp
Expand Down
4 changes: 4 additions & 0 deletions generator/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ public function setIsActive(bool $isActive): void
$projectData = buildDefaultCredentials($projectData);
$projectData['_isAcpLocalDevelopmentEnabled'] = isAcpLocalDevelopmentEnabled($projectData);

$dockerVersionObject = json_decode(getenv('DOCKER_VERSION', '{}'));
$skipVersionHeader = version_compare($dockerVersionObject?->Client?->Version, '26.0.0', '>=');
$projectData['_skipVersionHeader'] = $skipVersionHeader;

// TODO Make it optional in next major
// Making webdriver as required service for BC reasons
// todo: waitFor refactoring dependency + document + testing mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function exec(array $projectData): array
foreach ($projectData[ProjectDataRegionsConstants::REGIONS_KEY] as $regionName => $regionData) {
$regionServices = $regionData[ProjectDataServicesConstants::SERVICES_KEY] ?? [];

if (!isset($services[ProjectDataServicesConstants::BROKER_KEY][ProjectDataServicesConstants::SERVICES_NAMESPACE_KEY])) {
if (!isset($regionServices[ProjectDataServicesConstants::BROKER_KEY][ProjectDataServicesConstants::SERVICES_NAMESPACE_KEY])) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function exec(array $projectData): array
foreach ($projectData[ProjectDataRegionsConstants::REGIONS_KEY] as $regionName => $regionData) {
$regionServices = $regionData[ProjectDataServicesConstants::SERVICES_KEY] ?? [];

if (!isset($services[ProjectDataServicesConstants::KEY_VALUE_STORE_KEY][ProjectDataServicesConstants::SERVICES_NAMESPACE_KEY])) {
if (!isset($regionServices[ProjectDataServicesConstants::KEY_VALUE_STORE_KEY][ProjectDataServicesConstants::SERVICES_NAMESPACE_KEY])) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function exec(array $projectData): array
foreach ($projectData[ProjectDataRegionsConstants::REGIONS_KEY] as $regionName => $regionData) {
$regionServices = $regionData[ProjectDataServicesConstants::SERVICES_KEY] ?? [];

if (!isset($services[ProjectDataServicesConstants::SESSION_KEY][ProjectDataServicesConstants::SERVICES_NAMESPACE_KEY])) {
if (!isset($regionServices[ProjectDataServicesConstants::SESSION_KEY][ProjectDataServicesConstants::SERVICES_NAMESPACE_KEY])) {
continue;
}

Expand Down
2 changes: 2 additions & 0 deletions generator/src/templates/docker-compose.yml.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% if not _skipVersionHeader %}
version: "3.7"
{% endif %}

x-volumes:
&app-volumes
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% include "service/#{engine}/2.176/#{engine}.yml.twig" with _context only %}
{% include "service/#{engine}/2.442/#{engine}.yml.twig" with _context only %}
19 changes: 19 additions & 0 deletions generator/src/templates/service/mysql/mariadb-10.11/mysql.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{ serviceName }}:
image: mariadb:10.11
networks:
- private
labels:
'spryker.app.name': database
'spryker.app.type': services
'spryker.project': ${SPRYKER_DOCKER_PREFIX}:${SPRYKER_DOCKER_TAG}
healthcheck:
test: ["CMD", "mysqladmin", "ping", "--silent"]
interval: 10s
timeout: 10s
retries: 5
environment:
MYSQL_ROOT_PASSWORD: "{{ serviceData['root']['password'] }}"
LANG: C.UTF-8
volumes:
- {{ serviceName }}-{{ serviceData['engine'] }}-data:/var/lib/mysql:rw
- ./${DEPLOYMENT_PATH}/context/mysql/my.cnf:/etc/mysql/mariadb.conf.d/my.cnf:ro
8 changes: 8 additions & 0 deletions images/baked/assets/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ COPY --chown=spryker:spryker package.json package-lock.json ${srcRoot}/
COPY --chown=spryker:spryker frontend* ${srcRoot}/frontend
COPY --chown=spryker:spryker tsconfig*.json ${srcRoot}/
COPY --chown=spryker:spryker config/Yves ${srcRoot}/config/Yves
COPY --chown=spryker:spryker .npmrc ${srcRoot}/

ARG SPRYKER_NPM_TOKEN
ENV SPRYKER_NPM_TOKEN=${SPRYKER_NPM_TOKEN}

RUN if [ -n "$SPRYKER_NPM_TOKEN" ]; then \
sed -i "s|\${SPRYKER_NPM_TOKEN}|${SPRYKER_NPM_TOKEN}|" .npmrc; \
fi

ARG SPRYKER_ASSETS_MODE='development'
ENV SPRYKER_ASSETS_MODE=${SPRYKER_ASSETS_MODE}
Expand Down
3 changes: 3 additions & 0 deletions images/mount/cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ FROM ${SPRYKER_PARENT_IMAGE} as cli-development

ENV DEVELOPMENT_CONSOLE_COMMANDS=1

ARG SPRYKER_NPM_TOKEN
ENV SPRYKER_NPM_TOKEN=${SPRYKER_NPM_TOKEN}

0 comments on commit 957ae2e

Please sign in to comment.