Git Product home page Git Product logo

xphillyx / watt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from samsung/watt

0.0 0.0 0.0 371.51 MB

A Web Assembly Translation Toolkit (WATT), a new Web Assembly (WASM) application authoring tool that allows developers to create a WASM based library easily and use it to create WASM based applications.

License: Apache License 2.0

JavaScript 58.62% Shell 0.09% Python 0.87% HTML 32.98% CSS 1.82% Makefile 0.90% C++ 4.46% GLSL 0.01% C 0.19% Dockerfile 0.05%

watt's Introduction

WATT (WebAssembly Translation Toolkit)

License Build Status

WATT is server-based WebAssembly IDE.

If you want to contribute code, please check the contribution guidelines.

Prerequisites

Optional dependencies

  1. Tizen SDK for building .wgt packages
    • Install Tizen SDK
    • Install Tizen SDK Native CLI development packages
      • For IDE Tizen SDK installer use Tizen Package Manager GUI and install Native CLI from Tizen SDK tools
      • For CLI Tizen SDK installer use package-manager-cli.bin in TIZEN_SDK_PATH/package-manager
      ./package-manager-cli.bin install NativeCLI
    • Add tizen CLI-tool to the system PATH in the terminal where you run WATT
    export PATH=$PATH:TIZEN_SDK_PATH/tools/ide/bin/

Quick Start

  • Getting the sources:
git clone https://github.com/Samsung/WATT.git
cd WATT
  • Start the server:

WATT will run some internal executable files,

for this, WATT needs set paths of executable files on System Environment Variable(PATH).

If you don't start the server with launch, WATT could not provide full functionality.

./launch

Tests

To run the test suite, first install the dependencies, then run npm test:

npm install
npm test
  • Connect to the web server, the service is provided with port number 3000:
On browser, http://localhost:3000/

Developing Design Editor in WATT

  • Design Editor is located in libs/tau-wysiwig
  • After making DE changes launch WATT with bp option
./launch -bp
  • After making changes on already running WATT:
# in WATT directory
cd libs/tau-wysiwig
npm install
npm run-script build-watt
  • Always after making any DE changes in WATT console:
b

Running WATT in docker container

docker run hello-world
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
  • If user can not be added due to the following error, manually add your user to docker group, for example, using sudo vigr tool.
usermod: user 'foo' does not exist
  • WATT along with mongodb images can be built and run by:
./docker-run.sh
  • This pulls and builds necessary images if they do not exists on local machine. Otherwise, docker tries to use existing images even if they are out of dated. Add '--rebuild' paramter in order to create new image.

  • Ensure 3000 port to be free. You should see logs on terminal:

watt_container_1   | Listening on port 3000
watt_container_1   | TAUComm started
mongo_container_1  | 2019-03-11T07:18:23.178+0000 I NETWORK  [thread1] connection accepted from 172.19.0.3:36916 #1 (1 connection now open)
  • Open localhost:3000 in Browser.

Inspecting docker images.

WATT and mongodb images are composed together by docker-compose.yml. However, if you want to execute any command on particular image type:

docker run -it 5f142ecd12f5 bash

ImageId can be found from:

docker images

Building WATT in docker container

If you already did compose, for example, by invoking ./docker-run.sh you can attach to running container:

docker container attach 12cf98736487

And type 'b', container id comes from

docker container ls

Inspecting running container

It's possible to execute any command on running container:

docker container exec -i 12cf98736487 bash

Updating WATT in AWS instance

  • Make sure your .git folder is not huge since its size significantly increases docker image.
  • Install the AWS CLI
  • Build and push watt docker image to AWS repositories and finally restart all WATT instances by
./watt-aws-instances-update.sh AWS_ACCOUNT_ID [--simultaneous-image-push]
  • If you need additional steeps, for example, updating mongod image or create new repository just follow this guide.
  • Images should be available at repositories.
  • Running task should be available here
  • Verify if WATT starts properly by inspecting the logs.
  • Check instance by visiting TAU checkbox sample.

WATT instances on AWS

Creating new AWS instance in desired AWS region

ecs-cli up --force --keypair id_rsa --capability-iam --size 1 --instance-type t2.large --vpc vpc-0d05d256d9261ccb5 --subnets subnet-0b31dfed2f9dddb0a --security-group sg-09d2b747ca8b77f1a --cluster-config watt-cluster-config --region REGION_CODE
  • To find subnet id go to Subnet dashboard change the region and copy public subnet id associated with newly created VPC.
  • Get WATT and mongod images using the following script:
./docker-run.sh --rebuild
  • You don't have to necessarily wait for complete WATT set up in docker environment. It's enough to have required images that can be checked by:
docker images
  • Visit docker repositories, change the region and create repositories for WATT and mongod images.
  • Update docker-compose-aws.yml with new docker images repositories and awslogs-region.
  • You can change default memory limits for each container in ecs-params.yml
  • Deploy the Compose File to a Cluster, for example,
ecs-cli compose --file docker-compose-aws.yml --verbose up --create-log-groups --cluster-config watt-cluster-config --region REGION_CODE
INFO[0003] Couldn't run containers                       reason="RESOURCE:MEMORY"
  • See watt-awslogs-group at CloudWatch, change the region
  • Logs can be also download them by
aws logs get-log-events --log-group-name watt-awslogs-group --log-stream-name watt/watt_container/ID --output text --region REGION_CODE
  • If you see 'Invalid command () was entered' please follow further steps
  • Due to no support for interactive mode in compose there is a need to manually edit task definition
  • Go WATT Task Definition and change the region.
  • Click "Create new revision".
  • At the bottom, click on "Configure via JSON" button and replace null to true for the following properties in watt (not mongodb) container:
"interactive": true,
"pseudoTerminal": true,

License

Refer WATT License

watt's People

Contributors

hunseopjeong avatar grzegorz-czajkowski avatar lmslachciak avatar kwanghyuk-kim avatar pkaczmarczy avatar ws29jung avatar singa2000 avatar jw00 avatar tomaszlukawskisam avatar hyundukkim avatar andy-cho avatar somang-park avatar sy302-park 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.