cancel
Showing results for 
Search instead for 
Did you mean: 

Deploy cap-devtoberfest to BTP Cloud Foundry

05-23-2023 2:44 PM
petr_havir99 Explorer
762 views 0 comments
0 Likes
SAP Managed Tags
Subscribe

Hi all,
I tried to deploy git project cap-devtoberfest, but it didn't work.
My goal is deploy cap-devtoberfest app with postreSQL hyperscale option.

Because BTP is now at cflinuxfs4 and project is for cflinuxfs3 I changed in MTA.yaml stack to cflinuxfs3. Changed nodejs buildpack versions 0.3.0, 0.2.0 and 0.2.1.
Changed command line to chmod 755 ./deploy.sh && ./deploy.sh . Also tried only ./deploy.sh or chmod 755 deploy.sh

Project in localhost with my postreSQL database works, but when I am at SAP BTP Visual Studio make in CMD - mbt build and deploy to SAP BTP cloud it doesn't work.

Deployment finished correcly, service is correctly created and bind to both srv and deployment app, but when I start app devtoberfest-db-deployer for deploy cds to postreSQL database and import data it fails.

Do you have any suggestion, please?

Exit status 137 -> exceeded memory, but I tried also 1024MB, 2048MB for memory, but it won't help me.

I' am facing these errors:

When deployemnt from Visual Studio:
First error:

Second error:

When I tried to start deploy db application from cocpit:
First error:

mta.yaml

## Generated mta.yaml based on template version 0.4.0## appName = devtoberfest## language=nodejs; multiTenant=false## approuter=

_schema-version: "3.1"ID: devtoberfestversion: 1.1.3description: "A simple CAP project."

parameters: enable-parallel-deployments: true

build-parameters: before-all: - builder: custom commands: - npm install - npx -p @sap/cds-dk cds build

modules:

- name: devtoberfest-db-deployer 

type: custom 

path: gen/db 

parameters: buildpacks: [https://github.com/cloudfoundry/apt-buildpack#v0.2.10, nodejs_buildpack] 

no-route: true 

no-start: true 

disk-quota: 3GB 

stack: cflinuxfs3 

memory: 512MB 

tasks: 

- name: deploy_to_postgresql 

command: chmod 755 deploy.sh && ./deploy.sh 

disk-quota: 3GB 

memory: 512MB 

build-parameters: ignore: ["node_modules/"] 

requires: - name: devtoberfest-database

# --------------------- SERVER MODULE ------------------------ 

- name: devtoberfest-srv 

# ------------------------------------------------------------ 

type: nodejs 

path: gen/srv 

parameters: 

stack: cflinuxfs3 

provides: 

- name: srv-api # required by consumers of CAP services (e.g. approuter) 

properties: 

srv-url: ${default-url} 

requires: 

- name: devtoberfest-database

resources: 

- name: devtoberfest-database 

parameters: path: ./pg-options.json 

service: postgresql-db 

service-plan: trial 

skip-service-updates: 

parameters: true 

service-tags: - plain 

type: org.cloudfoundry.managed-service

package.json

{ 

"name": "devtoberfest", 

"version": "1.0.8", 

"description": "A simple CAP project.", 

"repository": "<Add your repository here>", 

"license": "UNLICENSED", 

"private": true, 

"dependencies": { 

"@sap/cds": "^5.9.1", 

"cds-dbm": "^0.1.4", 

"cds-pg": "^0.1.36", 

"express": "^4", 

"npm": "9.6.7" }, 

"devDependencies": { 

"mbt": "~1.2.23" }, 

"cds": { 

"build": { 

"tasks": [ 

{ "use": "node-cf", 

"for": "node-cf", 

"src": "srv" }, 

{ "use": "cds-dbm/dist/build/postgres-cf", 

"for": "postgres-cf", 

"src": "db", 

"options": { "deployCmd": "npx cds-dbm deploy --load-via delta --auto-undeploy" } } ] }, 

"requires": { "db": { "kind": "postgres", "dialect": "plain" }, 

"postgres": { "impl": "cds-pg", "model": [ "srv" ] } }, 

"migrations": { "db": { "schema": { "default": "public", "clone": "_cdsdbm_clone", "reference": "_cdsdbm_ref" }, 

"deploy": { "tmpFile": "tmp/_autodeploy.json", "undeployFile": "db/undeploy.json" } } } }, 

"scripts": 

{ "start": "npx cds run", 

"start:docker": "docker-compose up", 

"build:cf": "mbt build", 

"deploy:cf": "cf deploy mta_archives/devtoberfest_1.0.0.mtar" }}}

apt.yml

keys:<br>

- https://dist.sapmachine.io/debian/sapmachine.old.key
- https://dist.sapmachine.io/debian/sapmachine.key
repos:

- deb http://dist.sapmachine.io/debian/amd64/ ./

packages:

- sapmachine-11-jdk
0 Likes

Accepted Solutions (0)

Answers (0)