Skip to content

Latest commit

 

History

History
147 lines (111 loc) · 7.18 KB

SETUP.md

File metadata and controls

147 lines (111 loc) · 7.18 KB

Setting up CircuitVerse

Back to README.md

Please go through the Contribution Guidelines before going forward with any development. This helps us keep the process streamlined and results in better PRs.

If you have any setup problems, please ensure you have read through all the instructions have all the required software installed before creating an issue.


Note

If you are facing any issues with the setup, first checkout the troubleshooting guide and if you are still facing issues, feel free to ask in the slack channel.

Installation

There are several ways to run your own instance of CircuitVerse:

Method Operating System Documentation
GitHub Codespaces Any Click Here
Gitpod Cloud Environment Any Click Here
Native Setup Linux Click Here
Native Setup Mac Click Here
Docker Development Environment Windows Click Here
Docker Development Environment Linux Click Here
Docker Development Environment Mac Click Here
WSL Setup Windows TODO
Native Setup Windows Click Here

Tools Setup

Tool Documentation Link
Code Auto Completion Click Here
Ruby Debugger Click Here

Tests

Before making a pull request, it is a good idea to check that all tests are passing locally.

  • To run the system tests, run bundle exec rspec .
  • To run the simulator tests, run yarn run test .

Note: To pass the system tests, you need the Chrome Browser installed. For docker based setup, you can ignore this.

CircuitVerse API documentation

CircuitVerse API documentation is available at - https://api.circuitverse.org/

If you like to setup CircuitVerse API documentation locally, refer docs/README.md

Enabling/Disabling features with Flipper

By default :forum and :recaptcha features are set to false. These can be enabled either via rails console or Flipper dashboard.

rails c

# Enable features (:recaptcha, :forum)
> Flipper.enable :recaptcha

# Disable features (:project_comments, :lms_integration)
> Flipper.disable :forum

Flipper dashboard can be accessed at - http://localhost:3000/flipper/ from where following features can be enabled/disabled.

Note : User need to log in as admin first, then only Flipper dashboard can be accessed If you have followed the provided setup documentation, you can log in as admin with following credentials.

User: Admin
Email: [email protected]
Password: password

Production

The following commands should be run for production:

bundle install --with pg --without development test
RAILS_ENV=production bundle exec rake assets:precompile
bundle exec sidekiq -e production -q default -q mailers -d -L tmp/sidekiq.log

Third Party Services

The .env file only needs to be used if you would like to link to third party services (Facebook, Google, GitHub, Gitlab, Slack, Bugsnap and Recaptcha)

  1. Create an app on the third party service (instructions)
  2. Make the following changes in your Google, Facebook, GitHub or Gitlab app:
    1. Update the site url field with the URL of your instance, and update the callback url field with <url>/users/auth/google, <url>/users/auth/facebook, <url>/users/auth/github or <url>/users/auth/gitlab respectively.
  3. Configure your id and secret environment variables in .env. If .env does not exist, copy the template from .env.example.
  4. After adding the environment variables, run dotenv rails server to start the application.

(Optional) yosys installation for Verilog RTL Synthesis

If you wish to do Verilog RTL Synthesis/create CircuitVerse Verilog Circuits in your local development environment, you need to:

  1. Install yosys
  2. Setup and run CircuitVerse's yosys2digitaljs-server.

Installation steps

  1. Install yosys

    • Many Linux distibutions provide yosys binaries which is easy to install & small in package size. For Example, For Debina/Ubunutu: sudo apt install yosys

    • For other linux distributions, MacOS, & Windows OS, you need to install the OSS CAD Suite

      1. Download an archive matching your OS from the releases page.
      2. Extract the archive to a location of your choice (for Windows it is recommended that path does not contain spaces)
      3. To use OSS CAD Suite

      Other Linux distros and macOS

      export PATH="<extracted_location>/oss-cad-suite/bin:$PATH"
      
      or
      
      source <extracted_location>/oss-cad-suite/environment

      Windows

      from existing shell:
      <extracted_location>\oss-cad-suite\environment.bat
      
      to create new shell window:
      <extracted_location>\oss-cad-suite\start.bat
      
  2. Setup CircuitVerse yosys2digitaljs-server

    • In your local CircuitVerse Repository:
      git clone https://github.com/CircuitVerse/yosys2digitaljs-server.git
      
      cd yosys2digitaljs-server
      
      yarn
      
      cd ..
    • To use CircuitVerse yosys2digitaljs-server:
      bin/yosys

Distributed Tracing using Opentelmetry

Refer otel docs

Third Party Services

The .env file only needs to be used if you would like to link to third party services (Facebook, Google, GitHub, Gitlab, Slack, Bugsnap and Recaptcha)

  1. Create an app on the third party service (instructions)
  2. Make the following changes in your Google, Facebook, GitHub or Gitlab app:
    1. Update the site url field with the URL of your instance, and update the callback url field with <url>/users/auth/google, <url>/users/auth/facebook, <url>/users/auth/github or <url>/users/auth/gitlab respectively.
  3. Configure your id and secret environment variables in .env. If .env does not exist, copy the template from .env.example.
  4. After adding the environment variables, run dotenv rails server to start the application.