Deploying a non-Web app (python) on IBM Bluemix without procfile? - ibm-cloud

manifest.yml file:
---
applications:
- name: myapp1
memory: 512M
command: python abc.py
no-route: true
Procfile:
web: python abc.py
When i delete the Procfile my script does not run, even though i have specified a command to start the script in manifest file. Also, the fact the Procfile has web: in it makes me think it's trying to run it as a webapp? it is not meant to run as a webapp with an open port, it is only meant to make outbound connections.

The procfile may be needed, depending on the Cloud Foundry version (only an old version). See this Python buildpack information.
You can use the command section in the manifest file to specify the start command (as shown in your example).
If your app is not a web app and does not have a route, you need to specify the no-route option in the manifest file. Else the health checker will fail because it tries to access your app as "web app" and test its accessibility.

Related

google cloud shell editor fails to run on cloud run emulator with error DEVINIT_REGISTER_BUILD_DEPS

I used google cloud shell editor and created one sample app successfully and it worked ok. then a few days later, when I did the same, I started to see the error DEVINIT_REGISTER_BUILD_DEPS and can not make it work anymore. I have no idea what changed and how I can fix it. any insights?
==steps==
1.start cloud shell editor
2.create a new application (with python flask)
3.perform run on clould Run emulator
==the following messages shown==
Starting to run the app using configuration 'Cloud Run: Run/Debug Locally' from .vscode/launch.json...
To view more detailed logs, go to Output channel : "Cloud Run: Run/Debug Locally - Detailed"
Dependency check started
Dependency check succeeded
Unpausing minikube
The minikube profile 'cloud-run-dev-internal' has been scheduled to stop automatically after exiting Cloud Code. To disable this on future deployments, set autoStop to false in your launch configuration /home/yoshikiasahara/hello-world-2/.vscode/launch.json
Update initiated
Update failed with error code DEVINIT_REGISTER_BUILD_DEPS
listing files: file pattern [requirements.txt] must match at least one file
Skaffold exited with code 1.
Cleaning up...
Finished clean up.

Unable to build docker compose with Azure Function project in Visual Studio 2019

I'm trying to add an Azure Function project to a docker-compose file created in Visual Studio 2019 (16.7.6), but this causes the solution to fail to build.
(Docker for Windows 2.4.0.0 (48506), with WSL2 support enabled, running in Linux container mode on Windows 10 Pro 2004)
Steps to reproduce:
Create a new solution with a Web Api project 'Web' that includes docker
support.
Add a new Azure Function project 'Func' with an Http trigger
function and then added docker support via Visual Studio Add >
Docker Support option.
Add 'Container Orchestration Support' to Web
project to generate a docker-compose.yml file that has the web app
At this point the solution builds debugging works for the web or func app in docker or docker-compose - all good.
When 'Func' project is added manually to docker-compose.yml the solution no longer builds:
CTC1031 Linux containers are not supported for Func project
Project: docker-compose
File: Microsoft.VisualStudio.Docker.Compose.targets
Line 303
However, I can run docker-compose fine from the command line:
docker-compose -f docker-compose.yml up
and both Web and Func app start up fine.
My docker-compose.yml file is
version: '3.4'
services:
web:
image: ${DOCKER_REGISTRY-}web
build:
context: .
dockerfile: Web/Dockerfile
func:
image: ${DOCKER_REGISTRY-}func
build:
context: .
dockerfile: Func/Dockerfile
Any ideas why I get the above error when building the solution in Visual Studio?
Have the same issue. It seems that docker-compose project type allows to set up dependencies only to specific type of projects, like Sdk="Microsoft.NET.Sdk.Web", and does not allow to library projects like Sdk="Microsoft.NET.Sdk". Referencing Dockerfile from docker-compose.yml automatically sets up reference.
In case of wrong project type compose works, but compilation of docker-compose project fails.
I got the error as well:
CTC1031 Linux containers are not supported for
It probably means that your Output type for the project is set to Class Library instead of Console Application.

Building only required docker-compose.yaml services with VS Code Dev Container

I'm using VS Code Dev Container extension to develop and run my app inside a Docker container.
I'm using a docker-compose.yaml to re-use an already defined image with a dependent service.
Inside that docker-compose.yaml file I have yet another service for testing purposes. When VS Code starts it builds all of the services inside my docker-compose.yaml file, not just the two I need to develop my application.
I can see Dev Container extension runs the command Start: Run: docker-compose --project-name proj1 -f c:\dev\proj1\docker-compose.yaml -f c:\dev\proj1\.devcontainer\docker-compose.yml up -d --build
If it would have passed the service defined in devcontainer.json it would have built only it.
Is there a way to instruct VS Code's Dev Container extension to build only the service I need for my development?

preparing assets for Deploying - Sails v0.10

The documentation of sails (http://sailsjs.org/#/documentation/concepts/Deployment) says:
"Configure the 'production' environment so that all of your css/js gets bundled up, and the internal servers are switched into the appropriate environment (requires linker)"
I thought the linker folder is not used anymore in sails v0.10.(sails.js v0.10 create new project --linker not working Gruntfile.js not used):
"Sails v0.10 no longer uses the linker folder--it was just causing confusion."
If these two quotes are not a paradoxon I would love to hear why.
Can somebody explain that step of deployment above ("Configure the 'production' environment..requires linker")?
When I was deploying our Sails JS application, all I had to do was to set the environment variable NODE_ENV as "production":
export NODE_ENV="production"
I was using forever for keeping the server up, using the command:
forever start app.js --prod
The server then starts in production environment. Before starting, it automatically bundles up CSS and JS files into production.css and production.js respectively.

Fabfile with support for sqlalchemy-migrate deployments?

I have database migrations (with sqlalchemy-migrate) working well in my dev environment. However, I'm a little stumped about how to integrate this into my deployment process.
I'd like to use fabric to execute the manage.py file on the remote server but I'm not sure what to use for the repository value in this file. Referring to both 'appname/migrations' and '/usr/local/pylons/appname/env/lib/python2.6/site-packages/appname-05.egg/appname/migrations/'
both fail with a migrate.versioning.exceptions.InvalidRepositoryError
Does anyone have a fabfile and manage.py that plays nicely with sqlalchemy-migrate?
What I did was to generate a manage.py file per the sqlalchemy-migrations docs. In there I hacked it up to load our config information which includes the db auth info. In our case it's a Pylons app so it reads the proper Pylons config.ini file.
http://readthedocs.org/docs/sqlalchemy-migrate/en/latest/versioning.html#project-management-script
Then the fabric commands all interact with the manage.py file vs using the Python API directly. Since everything, from the SA-Migrate manage.py through the app itself I don't run into any sort of path issues like you mention.
Not sure this is a 'exact' fix but maybe helps.