CityScope / CS_CityIO

Serverside script for the cityscope platform
https://cityio.media.mit.edu
14 stars 8 forks source link

dockerize the backend #69

Closed Akatsuki-Ryu closed 4 years ago

Akatsuki-Ryu commented 5 years ago

Hello everyone. .

i have an idea maybe it can solve the server offline problem , maybe we can deploy the server side into a docker and run it on kubernetes . i tried it with some other projects , it is working quite well . the container will restart when it dies . i might try to write something when i have some time . maybe i can put the scanner and the dashboard into docker and nginx first .

RELNO commented 5 years ago

@Akatsuki-Ryu thanks -- any docker sample we can look at?

Akatsuki-Ryu commented 5 years ago

I will deploy one and make pull request I have time tomorrow . I will be making some sample codes and I will put them here .

yasushisakai commented 5 years ago

I would request to have the latest rust installed on the container.

Akatsuki-Ryu commented 5 years ago

I will make the container golang ready , Nginx in the front and also rust ready ( I am not familiar with rust. I will make a little research ) so that we can run the code on the server side and it will restart itself when dies I suppose .

yasushisakai commented 5 years ago

we are rolling out a rust version right now

Akatsuki-Ryu commented 5 years ago

sure . please share the source code if possible . I will make the docker container deploy for that as well . by the way , golang version is ready . please refer to my repo . https://github.com/Akatsuki-Ryu/CS_CityIO_Backend
I will continue working on it tomorrow.

install docker on your machine navigate to project folder in terminal $ docker-compose build $ docker-compose up

the container will be running . I will revert some changes now , I changed the IP address for testing ..

yasushisakai commented 5 years ago

https://github.com/CityScope/CS_CityIO_Backend/tree/rust_version

Akatsuki-Ryu commented 5 years ago

error: failed to load source for a dependency on sha256

can you instruct how I can solve this ? thanks /

yasushisakai commented 5 years ago

@Akatsuki-Ryu we have just rolled out the latest version today, and documentation is still catching up. thanks for being patient. the sha256 crate is a homebrew library which could be found at https://github.com/yasushisakai/sha256 you will need to build that too. I will make the building process easier once we know the rust version is reliable.

for the time being, I can provide a binary for ubuntu/mac if that helps.

Akatsuki-Ryu commented 5 years ago

I see , then I need to manually build the docker container. I will try it when I wake up .thank you very much . rust is providing sha2::sha256 as well . if possible we can use their dependencies ,

Akatsuki-Ryu commented 5 years ago

I compiled the app , since I dont know what is the port and api , I will be waiting for the documents then. . thank you

yasushisakai commented 5 years ago

the port is hardcoded to 8080 at the end of the main.rs https://github.com/CityScope/CS_CityIO_Backend/blob/master/src/main.rs

The API is listed below https://github.com/CityScope/CS_CityIO_Backend/wiki/API

Akatsuki-Ryu commented 5 years ago

oho. sorry didn't notice that line . :D

Akatsuki-Ryu commented 5 years ago

got the docker up and running . I will talk soon

Akatsuki-Ryu commented 5 years ago

I pushed one version, but you need to put the sha256 folder inside of your project folder to make the docker . go to the project folder , put the sha256 files in place , run $ docker-compose up then you may have to wait for 10 min when it is building .

https://github.com/Akatsuki-Ryu/CS_CityIO_Backend

Akatsuki-Ryu commented 5 years ago

i merged the latest code to my fork and dockerized it . please check sha256 should be in the root folder in order to put into the docker . so i changed the routing there

Akatsuki-Ryu commented 5 years ago

new version tested with docker . shall I make a pull request ?

===== oops , I just noticed that we are introducing the spl server module . I will check that as well .

yasushisakai commented 4 years ago

re-open if needed

Akatsuki-Ryu commented 4 years ago

thanks. i will contact if there is question