Installing binary package on heroku - build

I want to deploy a binary package on heroku for use by my application
I am using the new Cedar stack, the official documentation states that it is recommended to use the vulcan tool for building binaries for heroku
So , i just did that, and the result was a tar.gz file containing a mini linux file system
Now what? how to deploy that binary package to heroku?
all the available documentation refer to using vulcan with buildpacks to create new applications
but, i want to deploy this binary package to an existing application
The question is , How can i do that?
should i put it in my git repo and upload it? if so, where should i put it? and how to unpack it and deploy it correctly on heroku to be available and correctly configured?
thanks
Joe

You need to incorporate that compiled output into a buildpack. See https://devcenter.heroku.com/articles/buildpack-binaries
Start with the buildpack for the language you're working in -- ruby / python / node. You'll probably just unpack the tarball into the a subdirectory of the vendor directory in the buildpack. Push your forked buildpack up to github and then point heroku to the buildpack.

Related

Blender on IBM Cloud (Cloud Foundry)

I'm currently developing a web application (Django 2.0) application.
My app will be deployed on IBM Cloud (Cloud Foundry) using python build-pack.
One of my requirements is to install blender.
Everything else is very well, but for blender installation.
What I've tried so far was:
I tried access my app using SSH connection, but surely I don't have root access to apt-get install blender!!
And tried to include blender in packages.json file and push that file using cf push my-app.
But nothing worked for me.
In another shorter question: what is the main approach in Cloud Foundry Apps to install packages like when we use apt-get install in Ubuntu / Debian.
Please correct me if I did anything wrong, or guide me with headlines to solve this problem!!
I see a couple options for you to install packages if they cannot be installed using the regular requirements file (which is the preferred way):
Download the relevant libraries and put them in subfolders of the app before pushing it. The libraries will be uploaded. That is how I would do it.
Once you have an SSH connection, use secure copy (scp) to upload the files and place them in the subfolders where they are expected.
Regarding Blender, the question is what you need in addition to having the code copied over. Does it need a running daemon? Are there more dependencies? You would need to share more information about your specific app to answer that. Maybe, packaging everything as one or more containers and run it on Kubernetes or a combination of Cloud Foundry and Kubernetes is a better way.

Nexus 3.5.1 proxies from snapshot repo nothing but maven metadata files

I have upgraded nexus repository from 2.x to 3.x through following path:
2.4.14 -> 3.4.0 -> 3.5.1
All nexus services were packed in docker with data directory mapped from host's. For all services I use default either sonatype/nexus or sonatype/nexus3 containers. Nexus web interface is hidden behind nginx with simple reverse proxying.
I use the nexus service with boot-cj (with no credentials) tools which manages dependencies the same way as maven. Anyway the tool first downloads nexus-maven.xml with relevant sha1 files and tries to download jars. It works fine with all 2.x I had.
I created a proxy repository against remote sonatype-snapshots repo. When I start compilation I have Could not find artifact error. I found that the meatdata files are cached but all poms and jars.
I have tried to fix it by cleaning cache with the clean_cache file trick and more rough rm -rfv /srv/nexus3/nexus-data/cache/* with no success. There are no any logs about error. Also I have checked manually that required artefact exists in the remote repository. More obvious Rebuild index button gave no solution. I do not thing it is a problem with nginx, but who knows? Also leaving overnight to run the scheduled tasks did not help.
The expected artifact is org.eclipse.rdf4j:rdf4j:pom:2.3-20170901.145510-11.

Heroku / Rails: can't set path to vendorized dependencies

I've got a set of libs/headers/binaries that are used to build some gems in my app (specifically Boost and SWIG). I've pre-built everything on a cedar-14 docker image and put it all in my vendor directory, so I have "vendor/swig" and "vendor/lib/boost" etc. I've tried setting paths with both heroku config:set and by making a paths.sh file in .profile.d as recommended in the documentation but no luck.
Answer is you can't, you need to make a buildpack.

Heroku: Replacement for Anvil builds?

I used to use Anvil (through hammer) to build some native libs to be bundled with a rails app. Specifically I was building libapngasm using this:
https://github.com/Kagetsuki/heroku-buildpack-apngasm
Unfortunately it seems Anvil has been discontinued and I couldn't find any information on how to do a remote build and retrieve the resulting binaries through the Build API.
Is there a new alternative to Anvil? What is a "correct" way to do this?
OK, the official answer here was a little more obvious than I had expected. Basically if you're running the same gcc/libc~ as that stack your dyno is running compile locally. Otherwise just spin up a VM or a docker image with a compatible version and build on that. Then just vendorize the libraries/binaries into your app repository so they'll be bundled up with the slug when you push. Finally, set your heroku environment load path to find the libs/bins you bundled.

Creating an app on Heroku with Django and NPM

I'm writing a Django app that includes some CoffeeScript in it. To allow for this I'm using django-compressor which compiles the CoffeeScript to JS before the app is launched. django-compressor requires that NPM is installed on the machine to compile the CoffeeScript.
Now I want to deploy this app on Heroku. I can't put npm in my requirements.txt so I am wondering how I can get npm on the Heroku server?
If you want to avoid maintaining a custom buildpack, you can use the multi buildpack.
Using the multi buildpack is super simple:
Run heroku config:add BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
Create a .buildpacks file in the root of your repository with two lines:
https://github.com/heroku/heroku-buildpack-nodejs.git
https://github.com/heroku/heroku-buildpack-python.git
Create a package.json file with your npm dependencies.
Run npm install
Note: The multi buildpack is a much nicer way to accomplish this these days :)
I've created a fork of the official Python heroku buildpack that allows an optional npm_requirements.txt for installing such dependencies.
I am now using coffeescript and less-css with django-compressor on heroku :)
https://github.com/jiaaro/heroku-buildpack-django
Edit: To switch to my buildback from the standard buildpack:
use the heroku command line app to set the BUILDPACK_URL environment variable:
heroku config:add BUILDPACK_URL=git://github.com/jiaaro/heroku-buildpack-django.git
You can create your own buildpack, that mix nodejs buildbpack and python buildpack. Or compile your CoffeeScript on your machine and put it on S3.
I found this question in Google while solving the same problem for myself.
I merged two official buildpacks (python and nodejs), so now one can have Django project with standard npm-description file package.json by running this command:
heroku config:add BUILDPACK_URL=https://github.com/podshumok/heroku-buildpack-python
This solution differs from Jiaaro's one in the following:
it is based on the newer (dec 12) versions of buildpacks (for example, it runs collectstatic on deployment)
you need correct package.json file (at least name and version of your product should be specified in this file)
npm dependencies should be listed in package.json
#Jiaaro 's solution didn't work for me... Causes some weird error... /:
File "almalinks/manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
Was too tired to deal with it, so I looked around and I found this nifty resource:
- The heroku-django cookbook
They explain how you can add your own scripts that hook into heroku's default buildpacks.
Worked like a charm. :)
Things have changed in Heroku land
There is no need for multi build packs, .builpack files, or custom build packs. Simply add the required official heroku build packs to your heroku app and they will execute in the order entered. Use the index option to reorder them as required.
heroku buildpacks:add --index 1 heroku/nodejs -a your_app_name
There is also no need for, gunt tasks, apps like django-bower, or other specialized tools that take up server resources and slow build time.
You can check out my tutorial on how to seamlessly integrate Django + Bower + Heroku here.