How can I push .Net Framework API to PCF? - asp.net-web-api

I am trying to push my .Net Native API to Pivotal Cloud Foundry. Below is the command I am giving for pushing my API.
cf push API-Name -s windows2012R2 -b binary_buildpack -c "start" -m 1G -p C:/Path
While running it will say "No start command detected" but when I did -c ? it showed me that start was a command. Then when I look at the log file it will show me:
ERR Could not determine a start command. Use the -c flag to 'cf push' to specify a custom start command.
and at the end it will say:
ERR Failed to create container
"reason"=>"CRASHED", "exit_description"=>"failed to initialize container"
Am I running the command wrong or is there something I need to do to my API to make it compatible?

I figured out that I had to set the health check off and my app and all instances are started now.
cf set-health-check NAME none

Related

Enabling DOCKER_CONTENT_TRUST causes docker & docker-compose commands to fail

a. Run the below export command in terminal:
export DOCKER_CONTENT_TRUST=1
b. Run :
docker-compose up --build -d
FAILURE:
ERRO[0000] Can't close tar writer: io: read/write on closed pipe
error during connect: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.41/build?buildargs=%7B%22EIS_VERSION%22%3A%222.4%22%2C%22GO_VERSION%22%3A%221.12%22%2C%22HOST_TIME_ZONE%22%3A%22Asia%2FKolkata%22%2C%22HTTPS_PROXY%22%3A%22http%3A%2F%2Fproxy-xyz.com%3A911%22%2C%22HTTP_PROXY%22%3A%22http%3A%2F%2Fproxy-xyz.com%3A911%22%2C%22NO_PROXY%22%3A%22127.0.0.1%2Clocalhost%22%2C%22UBUNTU_IMAGE_VERSION%22%3A%2218.04%22%2C%22http_proxy%22%3A%22http%3A%2F%2Fproxy-xyz.com%3A911%22%2C%22https_proxy%22%3A%22http%3A%2F%2Fproxy-xyz.com%3A911%22%2C%22no_proxy%22%3A%22127.0.0.1%2Clocalhost%22%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=dockerfiles%2FDockerfile.eisbase&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=ia_eisbase%3A2.4&target=&ulimits=null&version=1: invalid reference format
Sending build context to Docker daemon 12.55kB
I think DOCKER_CONTENT_TRUST locks some file wrt docker which causes this error.
docker-compose does not have any support for image signing or image signature verification.
— https://github.com/sse-secure-systems/trusted-compose
You need to implement a wrapper for docker-compose or use an existing one in order to work with content trust and docker-compose.
I don't use personnaly trusted-compose but it looks like as a good solution: https://github.com/sse-secure-systems/trusted-compose.
Additional resources:
Bringing Content Trust into the World of docker-compose (medium.com)
Docker Compose not using trusted content during pull (https://github.com/docker/compose)

GCloud: unable to listen on the Port defined by env variable

I am trying to deploy on Google Cloud Platform for the first time using the following two tutorials:
Gcloud build quickstart
Gcloud deploy quickstart
However, when running the final command gcloud builds submit --config cloudbuild.yaml, where cloudbuild.yaml is the name of the yaml file as per tutorial, throws the following error:
Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable. Logs for this revision might contain more information.
The image created by the build quickstart is not appropriate for the deploy quickstart. The latter, using Cloud Run needs something talking HTTP on port 8080.
If you using the deploy quickstart as-is, that should work. You can test this container image locally using:
docker run \
--interactive --tty \
--publish=8080:8080 \
gcr.io/gcbdocs/hello
and then try browsing or curling the endpoint http://localhost:8080. You should see Hello world!.
The error message from Cloud Run is somewhat generic and means that something went wrong. As a result it's often unhelpful.
If you're confident you're deploying a container image that talks HTTP on port 8080, I recommend you step through the instructions to try to see where you went wrong.

REST API for Hyperledger Composer to run without stop

I have managed to install and run Hyperledger composer on AWS .i was able to run composer-rest-server from Putty session .I started to work on the web application .
Although whenever i close the Putty Session , the server is down . now i need to make the server running all the time , in order to make the web application available all the Time .
What is the right command to do this ?
use the following command
nohup composer-rest-server -c <card-name> -n never -w true > rest-server.out> rest-server.err < /dev/null &
thanks
Use tmux if you are using ubuntu/centos then you can use following links
Ubuntu: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-tmux-on-ubuntu-12-10--2
Centos: https://www.linuxcloudvps.com/blog/install-and-use-tmux-on-centos/
Tmux will create a session for you and make your services run inside this session.
There is another way to make your services active, you can pull docker composer-rest-server image and run your services inside that container.
Link: https://hub.docker.com/r/hyperledger/composer-rest-server
Thanks

PuTTy "unknown option -o" when trying to connect

following the getting started guide I attempt to create & connect to a datalab vm instance with the command:
datalab create demo
but I get the following pop-up:
then, on ok-ing the error,
connection broken
Attempting to reconnect...
in the command prompt
Any idea how to have the keys generated a different way to allow me to connect?
As a workaround, you can try either running the datalab connect demo command from inside of Cloud Shell, or downgrading to version 153.0.0 of the Cloud SDK.
As for your error, this seems to be a newly introduced bug in the 154.0.0 release of the Cloud SDK.
Prior to that, running a command like gcloud compute ssh --ssh-flag=-o --ssh-flag=LogLevel=info demo would have resulted in the "-o LogLevel=info" flag being stripped out of the command prior to it running on Windows.
With the most recent release (154.0.0), however, those flags are now passed to the SSH command as-is. This causes an error on Windows, as the PuTTY CLI does not support the -o flag.
I've filed https://github.com/googledatalab/datalab/issues/1356 to track fixing this issue.
Sorry that you got hit by this.

how to check the Jboss (EAP 7) server running status via shell script

I have multiple jboss instance on a particular linux box . I don't want to grep the process id of jboss instance and listen port .Is there any work around from server.log or CLI command ?
In addition to the Panagiotis Chavarioti´s answer, the status of the application component also can be checked with the commands which are handy.
To check if JBoss server is started:
$JBOSS_HOME/bin/jboss-cli.sh -c --commands="read-attribute server-state"
To check if application is started:
$JBOSS_HOME/bin/jboss-cli.sh -c --commands="cd deployment,cd myapp.war, read-attribute status"
example:
$JBOSS_HOME/bin/jboss-cli.sh -c
'/host=sandbox/server=server1:readattribute(name=server-state)'
Try the following CLI command:
$JBOSS_HOME/bin/jboss-cli.sh -c
'/host=<HOSTNAME>/server=<SERVERNAME>:readattribute(name=server-state)'

Resources