Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Your units conversion service seems to be down... #205

Open
lendresen87 opened this issue Feb 15, 2022 · 11 comments
Open

Your units conversion service seems to be down... #205

lendresen87 opened this issue Feb 15, 2022 · 11 comments

Comments

@lendresen87
Copy link

Hi, your units conversion service mentioned in the docs seems to be down:
https://units.readthedocs.io/en/latest/_static/convert.html

Do you know when the service will be up again?

@phlptp
Copy link
Collaborator

phlptp commented Feb 15, 2022

It is back up now

@phlptp
Copy link
Collaborator

phlptp commented Feb 15, 2022

Are you actually using it?

@lendresen87
Copy link
Author

lendresen87 commented Feb 15, 2022

Thanks! Yeah, but we are looking into a more permanent solution, as the usage got a bit higher than expected.

@phlptp
Copy link
Collaborator

phlptp commented Feb 15, 2022

The webserver is pretty easy to run locally. Right now it is just running a docker image from docker hub on an AWS instance. You can run that docker locally or just compile the webserver and run that on whatever you like. Curious what you are doing with it.

And it looked like the docker server just stopped for some unknown reason, so I just restarted it.

@lendresen87
Copy link
Author

Cool, so in theory, we could set up something in our AWS and use that instead?
We have an app that generates some configuration files that we configure our hardware with. We are doing some readings on pressure and temperature and such, and needed a way to convert to the desired units.
We've been calling your REST API for that, but the number of conversions were higher than expected, so I am a bit worried we are calling your service more than it was built for. We have a meeting today to set up something running on our side, so that should fix it. Ps, great library that you have built :)

@lendresen87
Copy link
Author

So I am currently trying to build a docker image using your Docker file in the webserver folder, but it seems to be failing to find the units_webserver in the build folder.

#13 0.387 cp: cannot stat '../build/webserver/units_webserver': No such file or directory
#13 ERROR: executor failed running [/bin/sh -c cp ../build/webserver/units_webserver .]: exit code: 1

Do you have any theories to what could be wrong?
Also (can't hurt to ask), do you have an official docker image that is available to the public?

@lendresen87
Copy link
Author

So, I had to change this line in your Docker file order to make it build the image:
RUN cp ../build/webserver/units_webserver . && cp ../units/webserver/*.html . && cp ../units/webserver/*.sh .
to
RUN cp ../build/bin/units_webserver . && cp ../units/webserver/*.html . && cp ../units/webserver/*.sh .

I also updated the version label to 0.5.0.

@phlptp
Copy link
Collaborator

phlptp commented Feb 16, 2022

hmm, haven't looked at the dockerhub in a while. Guess it isn't updating anymore, looks like the webhooks changed

Anyway
https://hub.docker.com/repository/docker/phlptp/units/general
is supposed to be where some docker images get generated and are publicly available but looks like it isn't updating. I will see if I can get that working again and update the dockerfile.

@lendresen87
Copy link
Author

Thank you, that would be super :)

@phlptp
Copy link
Collaborator

phlptp commented Feb 16, 2022

The docker hub images are updated and working again

Here is a script I run on my EC2 instance

#!/usr/bin/bash

docker logs units_webserver &> /home/ec2-user/weblog/weblog$(date "+%s").log

docker stop units_webserver

docker container rm units_webserver

docker pull phlptp/units:webserver

docker run --name units_webserver -p80:80 -d phlptp/units:webserver

I think I run this once a day to automatically get the latest images and regenerate the server if it had stopped

@i-ky
Copy link

i-ky commented Feb 16, 2022

regenerate the server if it had stopped

You can use Docker restart policies in combination with health check command (either in Dockerfile or as docker run options).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants