GithubHelp home page GithubHelp logo

isabella232 / lxd-demo-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from canonical/lxd-demo-server

0.0 0.0 0.0 261 KB

The LXD demo server

Home Page: https://linuxcontainers.org/lxd/try-it

License: Apache License 2.0

Go 15.56% Shell 0.16% Smarty 0.51% CSS 1.83% HTML 3.71% JavaScript 78.22%

lxd-demo-server's Introduction

LXD demo server

This repository contains the backend code of the LXD online demo service.

https://linuxcontainers.org/lxd/try-it

What is it

Simply put, it's a small Go daemon exposing a REST API that users (mostly our javascript client) can interact with to create temporary test containers and attach to that container's console.

Those containers come with a bunch of resource limitations and an expiry, when the container expires, it's automatically deleted.

The main client can be found at the URL above, with its source available here:
https://github.com/lxc/linuxcontainers.org

Installing on Ubuntu

The easiest way to get the demo server running on Ubuntu is by using the snap package.

First install and configure LXD itself:

sudo snap install lxd
sudo lxd init

Then install and configure the LXD demo server:

sudo snap install lxd-demo-server
sudo snap connect lxd-demo-server:lxd lxd:lxd
sudo lxd-demo-server.configure

You can then access the server at: http://IP-ADDRESS:8080/

Dependencies

The server needs to be able to talk to a LXD daemon over the local unix socket, so you need to have a LXD daemon installed and functional before using this server.

Other than that, you can pull all the other necessary dependencies with:

go get github.com/lxc/lxd-demo-server

Building it

A very simple:

go build

Should do the trick.

Running it

To run your own, you should start by copying the example configuration file "lxd-demo.yaml.example" to "lxd-demo.yaml", then update its content according to your environment.

You will either need a container to copy for every request or a container image to use, set that up and set the appropriate configuration key.

Once done, simply run the daemon with:

./lxd-demo-server

The daemon isn't verbose at all, in fact it will only log critical LXD errors.

You can test things with:

curl http://localhost:8080/1.0
curl http://localhost:8080/1.0/terms

The server monitors the current directory for changes to its configuration file. It will automatically reload the configuration after it's changed.

Bug reports

Bug reports can be filed at https://github.com/lxc/lxd-demo-server/issues/new

Contributing

Fixes and new features are greatly appreciated but please read our contributing guidelines first.

Contributions to this project should be sent as pull requests on github.

Support and discussions

We use the LXC mailing-lists for developer and user discussions, you can find and subscribe to those at: https://lists.linuxcontainers.org

If you prefer live discussions, some of us also hang out in #lxcontainers on irc.freenode.net.

lxd-demo-server's People

Contributors

rsommer avatar stgraber avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.