How to debug custom slug crashing - scala

For various reasons we have decided to try to sidestep the slug-compilation and build our own slug locally to deploy through the API (as described here: https://devcenter.heroku.com/articles/platform-api-deploying-slugs).
The slug is built mostly like the java/scala buildpack using that buildpack jvm and is then combined with our play framework application dist file. Looking at the app dir of a normal/git-deployed app it looks aboutish the same.
Now, after deploying the slug through the api we get the expected dynos listed in the config page but the app crashes right away without giving any further information. Trying to attach a bash shell through heroku run bash it just times out.
Is there any way to get more information about why the app crashed out of heroku?

Ok, after some help from heroku support we figured out the following:
The slug tar files must be created so that the paths start with './' regular relative paths doesn't cut it. When we had that figured out we didn't really have any more big problems and now we have got a working alternative build and deploy to heroku pipeline that allows us to build or app locally and then deploy that.

Related

How to set up a docker-compose and Dockerfile to deploy a Laravel app?

I recently finished developing a Laravel 9 app, using wsl2 and sail, just like I was told in the Laravel documentation. Since it’s my first time deploying to live ever, I ran into some differences with local and production files such as .env, docker-compose.yml and Dockerfile.
I tried using guides and tutorials but I can’t seem to make sense as to how to make it work. I have a droplet with a non-root user with sudo privileges, since I used these two kind guides:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-20-04
after finishing with the installation, I tried to clone my app and run it like I do locally, and nothing happened. I realize I can’t use sail on the server, but what is the correct way to make it work?
All three local files (.env, docker-compose.yml and Dockerfile) were never edited.
use this repository docker-laravel
i have Php, Composer, and mariadb on it.

How to deploy angular2 on tomcat?

First I'd like to describe my set up:
I have a web service, let's call it "Cars", written in Java, that I've tested in eclipse with tomcat v6, working local (it was a requirement, so that once it works locally I can switch to do it with a "real" tomcat server so others can access). It works, it access the database, it offers an answer for certain URIs and so on.
I have coded in Plunker an angular 2 application, "WebCar", and I now want to run that on my computer, with a Tomcat server (unless there is a better way of doing it, I've been told to do it with Tomcat. Since I do not know any better option, that's why I talk about tomcat all of the time). With eclipse, I have already managed to get the app running, using palantir plugin for typescript https://marketplace.eclipse.org/content/typescript , and then running the project with a server-launch.js which contains require('lite-server'); , this allows me to see the same I saw on plunker, so, it works, but before I upload anything to the business servers I wanted to check everything works (hence the set up, which may not be necessary but it's what I come up with).
I now want to go one step further and use, if possible, tomcat v6 to run my angular 2 app, instead of simply using that lite server, so that I can test that it works, and then uploading it to a "real", remote server.
I would like to know what options are there, what would be a better option, and anything that is required to make an angular 2 deployment properly. So far I've found this
https://stackoverflow.com/a/34408495/6028947 " You only have to deploy
.js files, since anyway browser won;t" which I don't fully get,
http://jspm.io/ which is for SystemJS (I have an older version of
Angular 2 and use config.js)
https://stackoverflow.com/a/37568235/6028947 which talks about
angular-cli or webpack, which makes a bundle but if I got that
running, I still don't know what to do with it to upload to Tomcat
and then connect it to my web service.
So maybe the question should be (I don't know for sure): Once you get your angular 2 code bundled, what's next?
Btw there are a few other questions on stackOverflow, similar to this, but as far as I've seen, without any answer at all or with answers only obliquely related to this (and of course, nothing resembling a guide or step by step required)
Thanks to #nuzz for this ..
I'm running a little script to build the project and then copy it to tomcat. I'm telling angular what the base directory is that it will run under in tomcat.
#!/bin/sh
ng build --base-href /angular/ --prod
mkdir -p /home/xxx/apache-tomcat-8.0.37/webapps/angular
cp -R /home/xxx/angular-clitest/dist/* /home/xxx/apache-tomcat-8.0.37/webapps/angular/
Once thats run, start tomcat and you can access it at: http://localhost:8080/angular

Deploying Meteor + Angular2 app to Heroku

I have an app I'm writing using Meteor, Angular2 (using the angular-meteor package), Typescript, and MongoDB. I'm trying to put it up on Heroku and running into difficulties. I'm using this meteor buildpack. I'm not sure whether the problems are with Meteor, Heroku, or Angular2, though I suspect it's something Heroku isn't configuring correctly for Angular2. The site is at http://alfred-zahner.herokuapp.com/ and the error I'm getting is:
EXCEPTION: No provider for t! (e -> t)
I've checked the Heroku logs and there is no sign of trouble there. Part of my problem is that I can't see what t and e are, as someone (Heroku?) is uglifying the JavaScript. I'm not really sure how to proceed in debugging this.
One way to solve this problem would be to figure out and fix the error, but I'd be happy if there's a better build pack, or even a better (must be free!) hosting environment that I could be using.
Edit
It's not Heroku's problem. The same thing happens when deploying to Meteor's built in deployment testing (meteor deploy site.meteor.com). If I deploy using meteor deploy --debug site.meteor.com, however, it works, so Angular2 has some problem with the extra processing that happens when Meteor prepares an app for production.
On the angular2-meteor Github I found out that this is an issue with Angular 2 in particular, when using UglifyJS. For now, it seems the only solution is to use meteor deploy --debug. I'm planning to just use that on meteor's built in hosting until Angular 2 plays nicely.

Deploy Meteor code using a different version of Meteor?

I'm developing a Meteor app on cloud9 (c9.io) which is stuck on Meteor v0.5.9.
I'd like to try my app with 0.6.5.1 as I'm having a few unexplained issues.
Q: Is it possible to do a
meteor deploy myapp.meteor.com
and specify the version of Meteor.
I'm assuming not, as I guess everything's packaged up and deployed together, including Meteor itself?
Specify what version of Meteor to use locally suggest you can specify meteor versions, so may be I should set that just before deployment?
Thanks in advance.
Yes. In fact, it's the same argument as in the other question:
meteor deploy --release <tag of meteor> myapp.meteor.com
The tags are the same as in https://github.com/meteor/meteor/releases but without the release/ prefix.
However, in your case, the current version is 0.6.5.1 so if you just did a meteor update on your machine, that would be the default release for any deploy or bundling. Beware that it will be hard to go back to a previous version because of the various changes it will make.

Reduce slug size for Heroku with Play! 2.0 & Scala

I have a specific problem but the solutions are hopefully probably generic for similar problems.
I have a Play! framework 2.0 project, using Scala.
I am trying to deploy a new version to Heroku.
However for this project the deployment fails as the slug size is too big (101MB).
Now this app is very simple, so it is most likely a configuration problem. The current deployed version is/was using Play! 2.0-RC3 and the one I am trying to deploy is using version 2.0. That may be an issue?
I have tried to use a .slugignore file, ignoring .ivy2, project/boot etc, but to no avail.
Any other suggestions for how to reduce the slug size? When Using Play 2.x and Scala?
Here is the git push output (excluding the Selenium dependencies is probably a start)
Just follow the instructions on the bottom of this page. You simply fork https://github.com/heroku/heroku-buildpack-scala and change the bin/compile script towards its end as described in the Finetunig section.
EDIT: as of the time of this post the code was in the buildpack repository but not yet live, as per #JamesWard comments. I assume it will be released soon :)
I see that your application was started a few months ago. Try to remove the Heroku application and create it again from scratch.
Heroku's buildpack already contains the changes listed by Fynn to reduce slug size (tested yesterday), but if your aplication is old it may be that the changes were not added. Of course, you could modify your buildpack, but it may be simpler to just recreate the app.