How to avoid Edeliver deployment error: "vm.args: No such file or directory"? - deployment

Context
We are trying to use edeliver to deploy a "Hot Upgrade" of a Phoenix Web Application to a remote Virtual Machine instance.
Our aim is to build an "upgrade" version of the app each time so that the app can be "hot" upgraded in production without any down-time.
We have succeeded in doing this "hot upgrade" on a "Hello World" phoenix app:
https://github.com/nelsonic/hello_world_edeliver which is automatically deployed from Travis-CI when the build passes. see: https://travis-ci.org/nelsonic/hello_world_edeliver/builds/259965752#L1752
So, in theory this technique should work for our "real" app.
Attempting to Deploy a "Real" Phoenix App using Edeliver
Ran the following command (to build the upgrade):
mix edeliver build upgrade --auto-version=git-revision --from=$(git rev-parse HEAD~) --to=$(git rev-parse HEAD) --verbose
i.e. "build the upgrade from the previous git revision to the current one"
So far, so good. "Release successfully built!"
Error: vm.args: No such file or directory
When we attempt to deploy the upgrade:
mix edeliver deploy upgrade to production --version=1.0.3+86d55eb --verbose
cat: /home/hladmin/healthlocker/releases/1.0.3+86d55eb/vm.args: No such file or directory
Note: we have a little bash script that reads the latest upgrade version available in .deliver/releases and deploys that see: version.sh
Question:
Is there a way to ignore the absence of the vm.args file and continue the deployment?
Or if the file is required to complete the deployment, is there some documentation on how to create the file?
Note: we have read the distillery "Runtime Configuration" docs: https://github.com/bitwalker/distillery/blob/master/docs/Runtime%20Configuration.md and are sadly none-the-wiser ...
Additional Info
Environment
Localhost: Mac running Elixir 1.4.2
Build Host: Ubuntu 16.04.2 LTS running Elixir 1.4.5
mix.exs file: https://github.com/healthlocker/healthlocker/blob/continuous-delivery/mix.exs
edeliver version: 1.4.4
Build tool: distillery version: 1.4.0
Umbrella project: yes.
This question was also asked on: https://github.com/edeliver/edeliver/issues/234

As mentioned by others, the vm.args file is necessary for BEAM to run the release. A default file is created by distillery during the release build process and should be located in releases/<version>/vm.args. From your log output it looks like expected directory is being checked.
Can you show us the contents of /home/hladmin/healthlocker/releases/?
Can you confirm that the default vm.args file is being created when building the release and extracting it (outside of the upgrade process)?
You also asked:
Or if the file is required to complete the deployment, is there some documentation on how to create the file?
If diagnosing the problem with the default vm.args file doesn't get you anywhere, you can also write your own file and configure distillery to use that file instead of the default. The details for this are in the distillery configuration docs. In short,
add the vm_args setting to your distillery config, which should be at rel/config.exs(relative to your project root), for example:
environment :prod do
set vm_args: "<path>/vm.args"
[...]
end

Related

How to generate C API for onnxruntime on Linux

I am trying to build onnxruntime from source on Linux. According to this instruction I have successfully built python wheels and shared libs. But I have not seen headers for C API.
There is a build option --build_csharp which seems to enable C#/C packages. I tried to add this option but got following errors.
CMake Warning at CMakeLists.txt:137 (message):
Language Csharp is not found in the system
I installed dotnet-sdk-3.1 but still got this error. Can I ask how to properly generate onnxruntime C API on Linux? Thanks!
Please try the following steps:
- Steps to build ONNX from source code:
1. git clone --recursive https://github.com/Microsoft/onnxruntime
2. Get the commit ID of the version you want to build (In case you want older version)
3. git checkout "your commitID"
4. Install the required version of Cmake on your system
6. Run: <path>\build.sh --config Release --build_shared_lib --parallel
7. A build folder will be created in the onnxruntime.
5. Get the onnxruntime.dll from the dir: \onnxruntime\build\Windows\Release\Release
6. Get the required headers (onnxruntime_c_api.h, onnxruntime_cxx_api.h, onnxruntime_cxx_inline.h)
from the dir: \onnxruntime\include\onnxruntime\core\session and put it in the unit location.

Haskell and postgresql - build error "The program pg_config is required but it could not be found."

I am currently learning haskell and just tried using postgresql as a database.
I generated my project with stack (stack new <name> -> stack setup -> stack build)
and then all I changed was adding the dependencies needed to persistent and postgresql to the
package.yaml file (under "dependencies:").
These are:
persistent
persistent-postgresql
persistent-template
This however results in a failing build with the following message:
postgresql-libpq > setup.exe: The program 'pg_config' is required but it could not be found.
postgresql-libpq >
-- While building package postgresql-libpq-0.9.4.2 using:
C:\Users\\AppData\Local\Temp\stack14388\postgresql-libpq-0.9.4.2.stack-work\dist\e626a42b\setup\setup --builddir=.stack-work\dist\e626a42b configure --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\365a3dde\pkgdb --libdir=C:\sr\snapshots\365a3dde\lib --bindir=C:\sr\snapshots\365a3dde\bin --datadir=C:\sr\snapshots\365a3dde\share --libexecdir=C:\sr\snapshots\365a3dde\libexec --sysconfdir=C:\sr\snapshots\365a3dde\etc --docdir=C:\sr\snapshots\365a3dde\doc\postgresql-libpq-0.9.4.2 --htmldir=C:\sr\snapshots\365a3dde\doc\postgresql-libpq-0.9.4.2 --haddockdir=C:\sr\snapshots\365a3dde\doc\postgresql-libpq-0.9.4.2 --dependency=Cabal=Cabal-2.4.1.0-5rQrtDcYhR2LOcYye7obEr --dependency=Win32=Win32-2.6.1.0 --dependency=base=base-4.12.0.0 --dependency=bytestring=bytestring-0.10.8.2 -f-use-pkg-config --extra-include-dirs=C:\Users\\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include --extra-lib-dirs=C:\Users\\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\lib --extra-lib-dirs=C:\Users\\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\bin --exact-configuration --ghc-option=-fhide-source-paths
Process exited with code: ExitFailure 1
Does anyone know how to resolve this issue and why it even occurs?
Do I have to install postgresql just for being able to run build the project? If so, how would you
do this in production, when the database could basically lie everywhere?
It looks like Haskell is trying to build with the PostgreSQL client shared library libpq.dll and uses pg_config at build time to determine where PostgreSQL is installed and how it was built.
That would mean that you have to install PostgreSQL on the machine where you build Haskell, including the header files, build environment or however it is called by the installer.
For running Haskell you would only need libpq.dll and the dependent shared libraries.
I solved the issue in Ubuntu with the following command:
apt install libpq-dev

Gcloud app deploy failing with mongo-driver because of DataDog/zstd

I have been using mongo-driver in my project, deploying with gcloud app deploy for a while now. I recently rebuild my machine, and simply ran go get to get fetch ally my dependencies. Everything is compiling fine locally, however, gcloud app deploy fails:
Failed to build app: building app with command '[go build -o /tmp/staging/usr/local/bin/start ***\admin]', env '[PATH=/go/bin:/usr/local/go/bin:/builder/google-cloud-sdk/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=***HOME=/builder/home BUILDER_OUTPUT=/builder/outputs DEBIAN_FRONTEND=noninteractive GOROOT=/usr/local/go/ GOPATH=/go GOPATH=/tmp/staging/srv/gopath]': err=exit status 1, out=srv/gopath/src/go.mongodb.org/mongo-driver/x/mongo/driver/compression_cgo.go:15:2: cannot find package "github.com/DataDog/zstd" in any of:
/tmp/staging/srv/gopath/src/go.mongodb.org/mongo-driver/vendor/github.com/DataDog/zstd (vendor tree)
/usr/local/go/src/github.com/DataDog/zstd (from $GOROOT)
/tmp/staging/srv/gopath/src/github.com/DataDog/zstd (from $GOPATH).
Any ideas? app.yaml is just runtime: go113
Have you tried specifying dependencies with go mod yet?
I faced the same issue and finally can solved by generating go.mod file with these command,
GO111MODULE=on go mod init
GO111MODULE=on go mod tidy
Here is the details explanation.

Edeliver failing to start release

When running mix edeliver version production locally it fails with the following output
EDELIVER MYAPP WITH VERSION COMMAND
-----> getting release versions from production servers
production node:
user : app_user
host : my_app
path : /home/app_user/my_app.io
response: bash: line 4: bin/my_app: No such file or directory
bash: line 47: bin/my_app: No such file or directory
VERSION DONE!
The error is obvious, as the executable lives in: ~/my_app.io/my_app/_build/prod/rel/my_app/bin
I'm also unable to run any of the start/stop/restart etc commands
The deployment was successful because when I ssh in, and run the start command it works.
I would like to know if anyone can point me in the direction of some config parameter that I'm missing, as the local commands are a lot more efficient.
Figured out the problem
I only built my app by running the following: env MIX_ENV=prod mix edeliver build release
I was probably too excited and forgot to actually deploy the release using something similar to the following mix edeliver deploy release to production --version=0.0.1
Hope someone else might benefit from this also.

Hygieia - Creation of dashboard is failing

I'm working no setting up Hygieia dashboard.
Hygieia: https://github.com/gigaaks/Hygieia
Trying both approaches of setting it up locally or using Docker based installation/setup.
I'm successfully able to get mongoDB, it's API, UI modules up and running. Hygieia main login screen comes up fine. I successfully created the login user and able to log in.
At this point, I have mongoDB running, API, UI pieces running and it's time to create a CAP One / Split Dashboard (templates provided by Hygieia). When I provide the values for creating a new dashboard, it's throwing the following error in the API logs on the server (vagrant/VirtualBox instance) OR within the Docker's container.
What I found was there are lots of issues in this project's module where things are not correct i.e. database name in one module is dashboard, in other module it's dashboardb and in other, it's expecting dashboarddb. I fixed those issues in my github repo/project and initiated a pull request which is approved and will be merged. The following error though, tells my that Hygieia's UI piece is NOT sending a parameter what the API piece is expecting while trying to create a dashboard (in mongoDB). The parameter is "type" and as UI (Hygieia GUI) is not sending it (as per their latest code in GitHUB), the API is failing throwing an error saying that type variable value is passed as NULL. I found the same when I tried POST operation by sending the same JSON RestAPI query using Postman.
Due to this, I'm currently not able to create a dashboard and start using the collectors provided by Hygieia out of the box (for Stash, GitHub, Jenkins, SonarQube etc).
Has anyone of you have faced or found a workaround for this error/issue?
2016-04-01 02:40:40,357 WARN c.c.d.rest.RestApiExceptionHandler - Bad Request - bind exception:
org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors
Field error in object 'dashboardRequest' on field 'type': rejected value [null]; codes dashboardRequest.type,NotNull.type,NotNull.java.lang.String,NotNull]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [dashboardRequest.type,type]; arguments []; default message [type]]; default message [may not be null]
at com.capitalone.dashboard.rest.RestApiExceptionHandler.handleMethodArgumentNotValid(RestApiExceptionHandler.java:55) [api.jar!/:2.0.0-SNAPSHOT]
at org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler.handleException(ResponseEntityExceptionHandler.java:156) [spring-webmvc-4.1.7.RELEASE.jar!/:4.1.7.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_72-internal]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_72-internal]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_72-internal]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_72-internal]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) [spring-web-4.1.7.RELEASE.jar!/:4.1.7.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) [spring-web-4.1.7.RELEASE.jar!/:4.1.7.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) [spring-webmvc-4.1.7.RELEASE.jar!/:4.1.7.RELEASE]
The issue was coming due to that fact that I used Hygieia modules docker images built locally using Maven (mvn clean install ; mvn docker:build) but for the UI module, as I was getting an error message, I cherry picked that image from captial one/hygieia-ui image. For some reason, it didn't work and was showing the above error (as there could be API level changes).
I had to run the following to get Hygieia dashboard up and running in local machine:
git config --global --unset-all url.https
git config --global url."https://".insteadOf git://
npm config set prefix /usr/local
sudo npm install --color=false; sudo npm install -g bower gulp; sudo npm install bower install
mvn clean install; mvn docker:build
gulp serve
Now, everything is working as expected for creating dashboard (PS: You have to create mongo db database first using mongo command line as shows in Hygieia's documentation).
npm -g option will install bower and gulp globally. without -g, it'll also install the same locally. Global values actually refer the local values.
For docker based solution, I just used docker-comopose file and got it up and running.
NodeJS(node) version: v5.10.0
NPM (Node pkg mgr) : 3.8.3
Bower version : 1.7.9
Gulp version : [08:18:42] CLI version 3.9.1,[08:18:42] Local version 3.9.1,
Maven version : Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00)
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)
Java version :