gknauth
2020-11-16 21:17:15

@badkins I finally got to trying your script. I was able to use it to get all the pieces other than your app to build/install on an EC2 instance. Now the question is how to deploy your app. What I did so far was cd into ~deploy and do a git clone of your RacketCon repo. I had to create a symlink for raco since there was only a symlink for racket. I went into RacketCon/TodoApp and did ./run-tests and was doing Ok until it got to this point and then things started failing. I’m sure I’m not putting something in the right place. Where exactly does TodoApp go?


badkins
2020-11-16 21:20:13

@gknauth The axio-env.rkt file is kept outside of source control since there are secrets in it. I provide an example file that can be edited and renamed to axio-env.rkt


badkins
2020-11-16 21:20:19

I think that may be what you’re running into.


gknauth
2020-11-16 21:21:31

I see. Thanks!


badkins
2020-11-16 21:22:03

I think the location of the app is only important for two things: 1) The nginx config file will refer to the …/public directory as the root of the website, and 2) systemd will need to know where app.rkt lives.


gknauth
2020-11-16 21:22:17

Roger


gknauth
2020-11-16 21:40:42

Is the systemd setup done manually for the app.rkt? I don’t see it in the script. Maybe I’m blind.


badkins
2020-11-16 21:59:09

Yes, manually. The repo has an example systemd config file.


gknauth
2020-11-16 21:59:21

Just found it, thanks.


gknauth
2020-11-16 22:06:43

Since the systemd.service example mentions /home/deploy/RacketCon2020/TodoApp twice, I got a little mixed up because racket-cloud-setup.bash has server root /home/$USERNAME/$APP_NAME/current/public, which is different. I guess I could have a symlink $APP_NAME/current point to /home/deploy/RacketCon2020/TodoApp.


badkins
2020-11-16 22:08:29

I’d probably just edit the systemd config to where the app lives.


gknauth
2020-11-16 22:08:36

Ok


gknauth
2020-11-16 22:08:59

I’m glad your script installs emacs-nox, makes my life a lot easier.


badkins
2020-11-16 22:09:02

The scripts were mostly cobbled together from existing apps, and meant to serve as an example vs. an actual bootstrap :)


gknauth
2020-11-16 22:10:07

The reason I made the symlink was I ran your script first, which set up all the nginx stuff, and only later saw there were other things I’d have to change to where things really were.


gknauth
2020-11-16 22:22:07

Looks like I have to install some other things. raco test: 13 "./axio/axio-init-structs.rkt" standard-module-name-resolver: collection not found for module path: gregor collection: "gregor"


badkins
2020-11-16 22:25:11

Yes. I’m not sure of the best way to ask Racket about the packages that the Todo app depends on.


badkins
2020-11-16 22:26:30

I probably should’ve mad the Todo app a package, then it would probably be more straightforward.


badkins
2020-11-16 22:28:26

Hmm… raco show-dependencies doesn’t seem to do it.


gknauth
2020-11-16 22:29:53

raco test: 13 "./models/comment.rkt" standard-module-name-resolver: collection not found for module path: csv-writing collection: "csv-writing"


badkins
2020-11-16 22:29:56

You may need csv-writing, threading


badkins
2020-11-16 22:30:04

yup :)


badkins
2020-11-16 22:30:57

raco make todo-app.rkt should identify all the missing pieces I would think


gknauth
2020-11-16 22:31:51

Funny about dependencies, in the Scala world I built something to build a shared-library-like set of paths for JARs based on coursier. Been there.