Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gregorwolf/cap-python
CAP Application combined with Python
https://github.com/gregorwolf/cap-python
Last synced: 6 days ago
JSON representation
CAP Application combined with Python
- Host: GitHub
- URL: https://github.com/gregorwolf/cap-python
- Owner: gregorwolf
- Created: 2024-07-13T16:01:59.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-10T15:46:23.000Z (about 2 months ago)
- Last Synced: 2024-10-11T02:35:16.617Z (28 days ago)
- Language: Smarty
- Size: 138 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CAP Application combined with Python
This is a sample project combining a CAP application with a Python application. It's target runtime is the SAP Business Technology Platform (BTP) Kyma environment.
It contains these folders and files, following our recommended project layout:
| File or Folder | Purpose |
| -------------- | ------------------------------------ |
| `app/` | content for UI frontends goes here |
| `chart/` | HELM Charts |
| `db/` | your domain models and data go here |
| `srv/` | your service models and code go here |
| `srv-python/` | The Python application go here |
| `package.json` | project metadata and configuration |
| `readme.md` | this getting started guide |## Preconditions
- BTP Subaccount with Kyma Runtime
- BTP Subaccount with Cloud Foundry Space
- HANA Cloud instance available for your Cloud Foundry space
- BTP Entitlements for: _HANA HDI Services & Container_ plan _hdi-shared_
- Container Registry
- Command Line Tools: `kubectl`, `kubectl-oidc_login`, `pack`, `docker`, `helm`, `cf`
- Logged into Kyma Runtime (with `kubectl` CLI), Cloud Foundry space (with `cf` CLI) and Container Registry (with `docker login`)
- `@sap/cds-dk` >= 6.6.0## Local Development
To run the application locally, you need to start the CAP application and the Python application. To work directly with the HANA Cloud instance you need to connect to the Cloud Foundry Environment:
```bash
cf login --sso
```then you can deploy with:
```bash
cds deploy --to hana
cf create-service xsuaa application cap-python-uaa -c xs-security.json
cds bind -2 cap-python-uaa
```To run the CAP application you need to start the CAP application with:
```bash
cds watch --profile hybrid --auto-undeploy
```To run the Python application you need to start the Python application with:
```bash
npm run start:python
```## Prepare Kubernetes Namespace
1. Export the kubeconfig.yaml
```
export KUBECONFIG=~/.kube/cap-kyma-app-config
```2. Create and set the namespace
```
kubectl create namespace cap-python
kubectl config set-context --current --namespace=cap-python
```## Debug deployment
```bash
kubectl get pods
kubectl logs
kubectl describe pod
```## Cleanup services for local testing
```bash
cf delete-service-key cap-python-uaa cap-python-uaa-key
cf delete-service cap-python-uaa
```