Giter Site home page Giter Site logo

development-environment's Introduction

NOTE: This repository is part of the lastest version of Exercism, v3. It is not applicable for the older versions of Exercism.


Exercism Development Environment

Hello! 👋

This repository will provide you with Exercism's local development environment, which you can use to develop any part of the project.

Our aim is to get you to a working setup within 10 minutes from now, most of which will be spent downloading things, but if you have a slower internet connection, things may take longer.

It requires the following to install:

  • Docker: Docker needs to be installed but no Docker knowledge is required and you do not need a DockerHub account.
  • Ruby: Many of the scripts in this repository are written in Ruby. Any version 2+ is fine.
  • Git: In order to obtain this repository using the instructions below, you need git installed.

Windows users: We recommend using WSL2 and running the commands in a WSL-enabled terminal.

Updates: We have a Changelog which lists breaking changes with instructions to follow to ensure your development environment continues to work. Please check it reguarly.

Basic setup

The following instructions take you through getting the most basic setup working. We'll explain what actually happens below the hood, and how to configure things afterwards.

Update hosts file

As the website is expected to run at local.exercism.io, you should update your hosts file to have local.exercism.io resolve to 127.0.0.1 (localhost).

Getting set up

To start, run the following instructions line-by-line:

# Make a directory to host all of Exercism within
mkdir exercism

# Move into the new directory
cd exercism

# Clone this repository onto your computer
git clone [email protected]:exercism/development-environment.git

# Move into the new directory
cd development-environment

# Create your "stack" - the collection of parts of Exercism you
# want to run locally. To start with, copy the default file.
cp stack.default.yml stack.yml

# Start everything
./bin/start

Once the script has finished, the website will be running at http://local.exercism.io:3020.

Updating everything

The first time ./bin/start is run, it will download the latest versions of all the Exercism components for you to use. If you want to download and run the latest version of those components — which we advise doing regularly — run:

./bin/start --pull

If you face any issues getting started, we recommend running this step in case anything is cached locally from a previous installation.

Logs

Once the docker stack is running you can view the logs in real-time using:

docker-compose logs -f

You can watch the logs of a single component by specifying its name. For example, to tail the website logs:

docker-compose logs -f website

It is also possible to have container logs be output to the console. To enable this, pass the --tail argument to ./bin/start:

./bin/start --tail

Shelling into a component

You may want to access a shell on a running component to run commands or check what is going on. To access a shell on a running container you can use the provided bin/shell command. For example, to shell into the running website container, you would run:

bin/shell website

Stopping everything

To stop everything, run:

docker-compose stop

Alternatively, to stop everything and remove all data (including the database storage), run:

docker-compose down

Details for restarting individual components are explained below.

What is actually going on?

Docker Compose

We are using Docker Compose. Compose is a tool for defining and running applications made up of multiple Docker containers. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.

In the context of Exercism, each component (e.g. the website UI, an analyzer, the code that manages test runners) has it's own Dockerfile. These Dockerfiles are stored within each component's repository (often named dev.Dockerfile) and are built and pushed to DockerHub via GitHub Actions.

The code in this repository handles the creation of a docker-compose.yml and provides you with some wrapper scripts to run things. The bin/start script generates the docker-compose.yml by merging your local stack.yml file with docker-compose-full.yml. It then downloads the images from DockerHub (if missing locally) and starts them via docker-compose up.

Running with --pull checks DockerHub for updated images. Running with --build rebuilds any Dockerfiles where the have build: true set in stack.yml

Note: Docker for Windows by default stores its data on the C: drive, but this can be changed in the settings.

stack.yml

The stack.yml file is a Exercism-specific configuration file that allows you to select which components you want to run locally, and any configuration you want to do. The bin/start script then takes that configuration and does the work of turning it into a docker-compose.yml.

Every Docker image you download takes up storage space, and every docker container you run takes up memory, so the stack.yml file allows to you ensure that you only run the things that are necessary for whichever part of Exercism you are working on.

Advanced Usage

Working on certain components of the architecture

In order to working on a specific component of Exercism's architecture, you will need to have the relevant git repository downloaded locally. For example, if you wanted to work on the javascript-test-runner, you might do the following:

# Start in your general Exercism directory (the first you made in the instructions above)
cd exercism

# Clone the relevant repository
git clone [email protected]:exercism/javascript-test-runner.git

The next step is to navigate to the development-environment directory:

# Move into the directory for *this* repo
cd development-environment

Now edit the stack.yml file to both enable the component and set its source configuration option to true:

# stack.yml

enabled:
  - javascript-test-runner

configure:
  javascript-test-runner:
    source: true

Running ./bin/start will now mount the locally checked out repository in the Docker container. This means any changes you make to the local filesystem are reflected within the Docker container.

Depending on the reload-behaviour of the component you are working, you may need to restart the component after changes. For example, the Website live-updates any changes made to the code as Rails applications and designed to do so, but the Tooling Invoker does not as it is a more simple Ruby application. Restarting a component can be achieved by running a single command:

docker-compose restart tooling-invoker

Manually building docker images

In more unusual situations you may need to (re)build the docker image from source, rather than using a pre-provided image. This is especially true if you're planning on modifying the dependencies (local libraries, node modules, gems, dependencies, etc), as opposed to just changing source code. Dependencies are usually "baked" into the images at build time.

To rebuild an image from source, edit the stack.yml to include a build section for the component you want to build from source.

For example, to have the tooling-invoker build from source rather than using an image:

# stack.yml

configure:
  tooling-invoker:
    build: true

And then, to build it:

./bin/start --build

Each time you change the Dockerfile or dependencies it mounts (e.g. the Gemfile), you will need to rerun the start command with the --build flag.

Customizing Git integration

The development environment uses the track repositories (e.g. Ruby) as its source for track contents, such as its exercises, concepts and documentation.

If you are using the development environment to work on a specific track, you can instruct the website to use a specific repository (e.g. a local fork) rather than downloading the default repositories from GitHub. Currently, the database seeds contain only the Ruby track, so accessing your track's content via the Ruby track links/URLs is the easiest way to load your track's data to the local website (e.g. http://local.exercism.io/tracks/ruby) Additionally, if you do seed/instantiate other tracks, they will all be associated with the GIT_CONTENT_REPO that you specify. At some point in the future, the dev env will be upgraded to allow you to specify a repo for any track (and only that track).

These are three environment variables you can specify in your stack.yml that are used to customize the Git integration for the website component:

  • GIT_CONTENT_REPO: the Git repository to clone. You can use this to clone a fork (e.g. https://github.com/me/go) or a repository on the website container filesystem (e.g. file:///usr/me/go). If not specified, track repositories (e.g. https://github.com/exercism/ruby) are used.
  • GIT_CONTENT_BRANCH: the branch to checkout after cloning. If not specified, main is used.
  • GIT_DOCS_BRANCH: the branch to checkout after cloning the docs. If not specified, main is used.
  • GIT_ALWAYS_FETCH_ORIGIN: indicates if a git fetch runs each time information is retrieved from Git. If not specified, true is used.

Here is an example:

website:
  environment:
    GIT_CONTENT_REPO: "https://github.com/me/go"
    GIT_CONTENT_BRANCH: "my-branch"
    GIT_ALWAYS_FETCH_ORIGIN: false
    # Other environment variables ...

If you use a repo on the website container's filesystem, you still need to commit your changes for them to be picked up by the website. Your branch will also need to match the GIT_CONTENT_BRANCH from above. Only code and README changes will be picked up after committing. If you need to make changes to the directory structure (like adding an exercise) and/or config.json, you will need to use the following commands to rebuild your environment:

docker-compose --remove-orphans down
rm -rf tmp/exercism/*
bin/start --pull

Working with teams

The development environment keeps track of its teams in the https://github.com/fake-exercism organization, to prevent mutations to the actual Exercism teams. If you'd like to use your own organization, specify the GITHUB_ORGANIZATION environment variable for the website component in your stack.yml file.

Here is an example:

website:
  environment:
    GITHUB_ORGANIZATION: "my-exercism-test-org"
    # Other environment variables ...

FAQs?

Do I have to use this to work on Exercism?

No.

If you want to only work on a language track, without seeing it running in context of the website, you can just directly work on that repository. In fact, that is the most common way to work on tracks.

Similarly if you want to work on tooling (test runners, analyzers, representers, etc) and you are happy to develop them in isolation, you do not need to use this repository. Although you may choose to to see your work running in the context of the website.

If you want to work on the various components of the website itself, then this is the official and only-supported way to work. However, you do not have to use it. You can set things up and get things playing nicely together locally, but this will probably be challenging, and unlikely to be worth the investment of your time. Instructions for each component can be found in the individual repositories, but we do not maintain instructions on how to piece them altogether.

I'm on Mac and I get an error about Ruby

Mac OSX comes with a system ruby pre-installed. That can cause problems when using this, or other Ruby applications. If you're on Mac, and get one of the following errors, checkout this troubleshooting issue

/System/Library/Frameworks/Ruby.framework/Versions/3.1/usr/bin/ruby: bad interpreter: No such file or directory

ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/3.1.0 directory.

Error: The following directories are not writable by your user:
/usr/local/lib

I'm on Mac and the site doesn't load and/or is super slow

There are two likely scenarios here. The first thing to do is just wait longer. After running bin/start --pull, node may take 10 minutes or more to compile all of the javascript and css. If this fails, make sure you have allocated at least 8GB of memory to your docker containers (sorry ¯\_(ツ)_/¯).

Secondly, if you have mounted a git repo from your local filesystem, the Docker for Mac project has multiple long standing issues with mount performance. They are (hopefully) working on them. The best option is to shell into the website container and manually clone your repo there:

bin/shell website
git clone https://github.com/exercism/go.git /usr/src/go

Keep in mind, you'll need to re-run this step whenever you do a docker-compose down. It may be preferable to edit code on your local machine and push up to github in order to see your changes. We realize that neither option is ideal and we will work on making the development experience better as V3 becomes more mature.

Stuck?

Stuck running the Docker setup? Please open an issue in this repository, and we will try and help you fix things, and tweak things so other people don't face the same challenge.

If you have an issue unrelated to this local Docker setup, please open an issue in the relevant repository (e.g. for the JavaScript Test Runner, use https://github.com/exercism/javascript-test-runner). If you are unsure where to open the issue, please use https://github.com/exercism/exercism.

Contributing to this repository

We welcome contributions! Please open an issue explaining the problem(s) you are facing, or put together a Pull Request demonstrating your idea or solution. Thank you!

development-environment's People

Contributors

ekingery avatar erikschierboom avatar exercism-bot avatar ihid avatar joshgoebel avatar kntsoriano avatar kytrinyx avatar neenjaw avatar nobbz avatar saurabh896 avatar verdammelt avatar zacnomore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

development-environment's Issues

Detect the port at which the website is running in the bin/start script

The bin/start script is used to spin up the environment. There are two mentions of the website running on port 3020, and one test to see if the website has actually started that also uses that port. It is possible though for a student to change the port mapping in the docker-compose file, which would mean that the mentions and check would be incorrect. We should detect at which port the website runs and update the bin/start script.

Clarify Ruby version

Ruby: Many of the scripts in this repository are written in Ruby. Any version 2+ is fine.

Does 3.0.0, which is now the latest stable Ruby version, count as 2+?

Issue when running ./bin/start

I am trying to install and get the environment up and running but I run into this issue:

pertrai1@LAPTOP-M80I4EGU  ~/repos/development-environment   main  ./bin/start
  /--            --\
 ||                ||
 ||   ___    ___   ||
 ||  /   \  /   \  ||
<<                  >>
 ||     |    |     ||
 ||      \__/      ||
 ||                ||
  \--            --/

The following gems are missing
 * activesupport (6.1.3.2)
 * zeitwerk (2.4.2)
 * rubocop (1.15.0)
 * rubocop-minitest (0.12.1)
 * rubocop-performance (1.11.3)
 * exercism-config (0.81.0)
 * concurrent-ruby (1.1.8)
 * i18n (1.8.10)
 * minitest (5.14.4)
 * tzinfo (2.0.4)
 * parallel (1.20.1)
 * parser (3.0.1.1)
 * rainbow (3.0.0)
 * regexp_parser (2.1.1)
 * rexml (3.2.5)
 * rubocop-ast (1.5.0)
 * ruby-progressbar (1.11.0)
 * unicode-display_width (2.0.0)
 * aws-sdk-dynamodb (1.70.0)
 * aws-sdk-secretsmanager (1.55.0)
 * mandate (1.0.0)
 * ast (2.4.2)
 * aws-sdk-core (3.125.1)
 * aws-sigv4 (1.4.0)
 * aws-eventstream (1.2.0)
 * aws-partitions (1.545.0)
 * jmespath (1.4.0)
Install missing gems with `bundle install`
Fetching gem metadata from https://rubygems.org/.........
Your bundle is locked to exercism-config (0.81.0) from rubygems repository https://rubygems.org/ or installed locally,
but that version can no longer be found in that source. That means the author of exercism-config (0.81.0) has removed
it. You'll need to update your bundle to a version other than exercism-config (0.81.0) that hasn't been removed in order
to install.

I am running in WSL.

Thank you for your help.

Fix Dockerhub push

The GHA script needs fixing to push this to Dockerhub.

(cc @exercism/github-actions if anyone wants to do it before @ErikSchierboom gets round to it 🙂 )

Improve readme with info on data storage

@SaschaMann suggested adding into the readme about the following:

Docker for Windows (not sure about other OS) has a setting for where it should store the virtual harddrives (? not sure about the details tbh). It defaults to C: which may not be what you want.

Two Problems using stack.default.yml

(This issue report is based on behavior seen in commit 31fb904.)

I copied stack.default.yml to stack.yml as directed by the README and encountered two problems. Both where easy to work around but I wanted to report them in case they could be easily fixed or to at least let people know what to do if they hit the problems and could not easily debug the problem themselves.

#1: undefined method `data' for nil:NilClass (NoMethodError)

Running ./bin/start resulted in the stack trace:

Traceback (most recent call last):
	11: from ./bin/build_stack:4:in `<main>'
	10: from /Users/mark/SRC/exercism/development-environment/lib/docker_compose.rb:17:in `build_stack'
	 9: from /Users/mark/SRC/exercism/development-environment/lib/docker_compose/stack.rb:13:in `write_docker_compose'
	 8: from /Users/mark/SRC/exercism/development-environment/lib/docker_compose/stack.rb:46:in `prepare'
	 7: from /Users/mark/SRC/exercism/development-environment/lib/docker_compose/stack.rb:23:in `enabled_services'
	 6: from /Users/mark/SRC/exercism/development-environment/lib/docker_compose/stack.rb:23:in `map'
	 5: from /Users/mark/SRC/exercism/development-environment/lib/docker_compose/stack.rb:23:in `block in enabled_services'
	 4: from /Users/mark/SRC/exercism/development-environment/lib/docker_compose/stack.rb:30:in `resolve_group'
	 3: from /Users/mark/SRC/exercism/development-environment/lib/docker_compose/stack.rb:30:in `map'
	 2: from /Users/mark/SRC/exercism/development-environment/lib/docker_compose/stack.rb:32:in `resolve_group'
	 1: from /Users/mark/SRC/exercism/development-environment/lib/docker_compose/stack.rb:37:in `resolve_dependencies'
/Users/mark/SRC/exercism/development-environment/lib/docker_compose/stack.rb:58:in `service_for': undefined method `data' for nil:NilClass (NoMethodError)

Some debugging showed that this was happening because analyzers was included in enabled key but contained none in its section of groups. Commented out analyzers resulted in the same problem for other items with none values in groups (representers, language-servers`).

Workound: commented out these items or replace the none keys with appropriate values.

#2: Pulling language-server-proxy ... error

After working around the above error, running ./bin/start --pull results in an error:

ERROR: for language-server-proxy  pull access denied for exercism/language-server-proxy, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
ERROR: pull access denied for exercism/language-server-proxy, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

Workaround: comment out language-server-proxy from the groups/tooling section.

End-to-end run of iterations is not working

When trying to submit an iteration, the status does not change from pending. After some digging, the cause was this PR to the tooling-orchestrator, which enables tooling to output multiple files. Unfortunately, the other tooling bits (invoker and webserver) need to be updated to accomodate this changed interface.

How to run on Mac M1/M2

Has anyone been successful running the project on apple sillicon?

I'm getting the following errors (obtained from docker-compose logs):

development-environment-website-1               | server   | Puma starting in single mode...
development-environment-website-1               | server   | * Version 4.3.12 (ruby 3.1.0-p0), codename: Mysterious Traveller
development-environment-website-1               | server   | * Min threads: 5, max threads: 5
development-environment-website-1               | server   | * Environment: development
development-environment-website-1               | server   | * Listening on tcp://0.0.0.0:3020
development-environment-website-1               | server   | Use Ctrl-C to stop
development-environment-website-1               | js       | Browserslist: caniuse-lite is outdated. Please run:
development-environment-website-1               | js       |   npx browserslist@latest --update-db
development-environment-website-1               | js       |   Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
development-environment-website-1               | manifest | /usr/local/bundle/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:69:in `initialize': Function not implemented - Failed to initialize inotify (Errno::ENOSYS)
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/listen-3.0.8/lib/listen/adapter/linux.rb:31:in `new'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/listen-3.0.8/lib/listen/adapter/linux.rb:31:in `_configure'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/listen-3.0.8/lib/listen/adapter/base.rb:45:in `block in configure'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `each'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `configure'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/listen-3.0.8/lib/listen/adapter/base.rb:63:in `start'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/listen-3.0.8/lib/listen/backend.rb:28:in `start'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/listen-3.0.8/lib/listen/listener.rb:67:in `block in <class:Listener>'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `instance_eval'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `call'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/listen-3.0.8/lib/listen/fsm.rb:91:in `transition_with_callbacks!'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/listen-3.0.8/lib/listen/fsm.rb:57:in `transition'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/listen-3.0.8/lib/listen/listener.rb:90:in `start'
development-environment-website-1               | manifest | 	from /usr/src/app/bin/monitor-manifest:11:in `<main>'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/commands/runner/runner_command.rb:43:in `perform'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/command/base.rb:87:in `perform'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/command.rb:48:in `invoke'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/commands.rb:18:in `<main>'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
development-environment-website-1               | manifest | 	from /usr/local/bundle/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
development-environment-website-1               | manifest | 	from bin/rails:4:in `<main>'
development-environment-website-1               | manifest | Exited
development-environment-website-1               | sidekiq  | W, [2023-04-22T05:16:25.980897 #292]  WARN -- Skylight: [SKYLIGHT] [5.3.2] Running Skylight in development mode. No data will be reported until you deploy your app.
development-environment-website-1               | sidekiq  | (To disable this message for all local apps, run `skylight disable_dev_warning`.)
development-environment-website-1               | server   | Interrupting...
development-environment-website-1               | anycable | Interrupting...
development-environment-website-1               | sidekiq  | Interrupting...
development-environment-website-1               | ws       | Interrupting...
development-environment-website-1               | css      | Interrupting...
development-environment-website-1               | js       | Interrupting...
development-environment-website-1               | ws       |   INFO 2023-04-22T05:16:26.071Z context=main Shutting down... (hit Ctrl-C to stop immediately)
development-environment-website-1               | anycable | /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/journey/route.rb:115:in `to_sym': Interrupt
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/journey/route.rb:115:in `map'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/journey/route.rb:115:in `parts'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/route_set.rb:255:in `initialize'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/route_set.rb:191:in `initialize'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/route_set.rb:175:in `new'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/route_set.rb:175:in `create'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/route_set.rb:113:in `add'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/route_set.rb:594:in `add_route'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1962:in `add_route'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1933:in `decomposed_match'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1902:in `block in map_match'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1900:in `each'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1900:in `map_match'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1639:in `match'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:735:in `map_method'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:688:in `get'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1473:in `block (3 levels) in resources'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1862:in `path_scope'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1506:in `block in collection'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1742:in `with_scope_level'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1505:in `collection'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1472:in `block (2 levels) in resources'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:886:in `controller'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1750:in `resource_scope'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1467:in `block in resources'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1742:in `with_scope_level'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/mapper.rb:1465:in `resources'
development-environment-website-1               | anycable | 	from /usr/src/app/config/routes.rb:385:in `block in <main>'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/route_set.rb:426:in `instance_exec'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/route_set.rb:426:in `eval_block'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/actionpack-7.0.2.3/lib/action_dispatch/routing/route_set.rb:408:in `draw'
development-environment-website-1               | anycable | 	from /usr/src/app/config/routes.rb:4:in `<main>'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/application/routes_reloader.rb:50:in `block in load_paths'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/application/routes_reloader.rb:50:in `each'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/application/routes_reloader.rb:50:in `load_paths'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/application/routes_reloader.rb:24:in `reload!'
development-environment-website-1               | sidekiq  | /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/initializable.rb:21:in `before': Interrupt
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/initializable.rb:50:in `block in tsort_each_child'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/initializable.rb:50:in `select'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/initializable.rb:50:in `tsort_each_child'
development-environment-website-1               | sidekiq  | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:415:in `call'
development-environment-website-1               | sidekiq  | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:415:in `each_strongly_connected_component_from'
development-environment-website-1               | sidekiq  | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/initializable.rb:50:in `each'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/initializable.rb:50:in `tsort_each_child'
development-environment-website-1               | sidekiq  | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:415:in `call'
development-environment-website-1               | sidekiq  | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:415:in `each_strongly_connected_component_from'
development-environment-website-1               | sidekiq  | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
development-environment-website-1               | sidekiq  | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:347:in `each'
development-environment-website-1               | sidekiq  | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:347:in `call'
development-environment-website-1               | sidekiq  | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
development-environment-website-1               | sidekiq  | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
development-environment-website-1               | sidekiq  | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/initializable.rb:60:in `run_initializers'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/application.rb:372:in `initialize!'
development-environment-website-1               | sidekiq  | 	from /usr/src/app/config/environment.rb:18:in `<top (required)>'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/sidekiq-6.4.1/lib/sidekiq/cli.rb:273:in `require'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/sidekiq-6.4.1/lib/sidekiq/cli.rb:273:in `boot_application'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/sidekiq-6.4.1/lib/sidekiq/cli.rb:37:in `run'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/sidekiq-6.4.1/bin/sidekiq:31:in `<top (required)>'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/bin/sidekiq:25:in `load'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/bin/sidekiq:25:in `<top (required)>'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in `load'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in `kernel_load'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:23:in `run'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:484:in `exec'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:31:in `dispatch'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:25:in `start'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/bundler-2.3.7/exe/bundle:48:in `block in <top (required)>'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/gems/bundler-2.3.7/exe/bundle:36:in `<top (required)>'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/bin/bundle:25:in `load'
development-environment-website-1               | sidekiq  | 	from /usr/local/bundle/bin/bundle:25:in `<main>'
development-environment-website-1               | ws       |   INFO 2023-04-22T05:16:26.083Z context=rpc All active RPC calls finished
development-environment-website-1               | server   | - Gracefully stopping, waiting for requests to finish
development-environment-website-1               | server   | === puma shutdown: 2023-04-22 05:16:26 +0000 ===
development-environment-website-1               | server   | - Goodbye!
development-environment-website-1               | server   | Exiting
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/application/routes_reloader.rb:38:in `block in updater'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/activesupport-7.0.2.3/lib/active_support/file_update_checker.rb:83:in `execute'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/application/routes_reloader.rb:13:in `execute'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/application/finisher.rb:156:in `block in <module:Finisher>'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/initializable.rb:32:in `instance_exec'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/initializable.rb:32:in `run'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
development-environment-website-1               | anycable | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
development-environment-website-1               | anycable | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
development-environment-website-1               | anycable | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
development-environment-website-1               | anycable | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
development-environment-website-1               | anycable | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:347:in `each'
development-environment-website-1               | anycable | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:347:in `call'
development-environment-website-1               | anycable | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
development-environment-website-1               | anycable | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
development-environment-website-1               | anycable | 	from /usr/local/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/initializable.rb:60:in `run_initializers'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/railties-7.0.2.3/lib/rails/application.rb:372:in `initialize!'
development-environment-website-1               | anycable | 	from /usr/src/app/config/environment.rb:18:in `<top (required)>'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/anycable-core-1.2.2/lib/anycable/cli.rb:157:in `require'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/anycable-core-1.2.2/lib/anycable/cli.rb:157:in `boot_app!'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/anycable-core-1.2.2/lib/anycable/cli.rb:44:in `run'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/anycable-core-1.2.2/bin/anycable:7:in `<top (required)>'
development-environment-website-1               | anycable | 	from /usr/local/bundle/bin/anycable:25:in `load'
development-environment-website-1               | anycable | 	from /usr/local/bundle/bin/anycable:25:in `<top (required)>'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in `load'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in `kernel_load'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:23:in `run'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:484:in `exec'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:31:in `dispatch'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:25:in `start'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bundler-2.3.7/exe/bundle:48:in `block in <top (required)>'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
development-environment-website-1               | anycable | 	from /usr/local/bundle/gems/bundler-2.3.7/exe/bundle:36:in `<top (required)>'
development-environment-website-1               | anycable | 	from /usr/local/bundle/bin/bundle:25:in `load'
development-environment-website-1               | anycable | 	from /usr/local/bundle/bin/bundle:25:in `<main>'
development-environment-website-1               | sidekiq  | Exited
development-environment-website-1               | anycable | Exited
development-environment-website-1               | server   | Exited
development-environment-website-1               | js       | Exited
development-environment-website-1               | ws       | Exited
development-environment-website-1               | css      | Exited
development-environment-website-1 exited with code 1

Ruby on Mac troubleshooting

Mac OSX and ./bin/start

Mac OSX comes with a system ruby pre-installed. This ruby can't be "editing" by regular means and any attempt to do so will fail. Tutorials might tell you to use sudo, but you shouldn't. A common error is the following:

./bin/start: /usr/local/bin/bundle: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory

Mac OSX is trying to use the system Ruby to run ./bin/start which is looking for the bundle binary. It won't correctly find it. If you then try to gem install bundler to try to fix it, you might run into:

ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

This means Ruby is likely installed using sudo. You should uninstall ruby using sudo, and then install it without sudo.
If you try to run brew install ruby, you might run into:

Error: The following directories are not writable by your user:
/usr/local/lib

This means brew is likely installed using sudo. You should run the following commands to fix this:

sudo /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Also something about brew info ruby because needs to follow those instructions to get it on the path.

Add daemon setting.

Can we add a config setting for daemon, which is set to true by default, but if false just doesn't use the -d flag? I would choose to run this not in daemon mode so that the logs stream in the console.

@joshgoebel @ErikSchierboom Whichever of you gets round to this first, please add a comment to say you're working on it :)

Documentation improvements for first timers

Hey,

Great work on the dev environment.

Comments while working through the setup:

  • There is a delay from the time that ./bin/start says the website is running until the time when it is actually running.
    • This time is probably normal spin up time, but it might be worthwhile and preemptive to state that there might be some delay.
  • Also noted that the setup container shuts itself down once the system is running. When looking at my docker widget I wasn't sure if this is normal, but the system appears to be running. If this is normal and expected it might be worth noting.

Now my question, If I were to be writing a rails ruby module, how should I be running the tests (e.g. ActiveTest)?

  • Does the website have to be running at that moment? Or just parts of it (DB, etc).
  • Are they run locally, or do you have to shell in to one of the docker containers?

I'm happy to PR the documentation with these updates

Thanks

Sort windows line endings

@SleeplessByte tells me that this repo is not setup with correct line endings so this doesn't run on windows wsl by default. Line endings need adding to .gitattributes to fix this. This explains more.

This is the option we want:

text eol=lf

Git will always convert line endings to LF on checkout. You should use this for files that must keep LF endings, even on Windows. Since this must run in a linux context, probably a good choice.


@ErikSchierboom As the master of the Windows universe, I'll assign this one to you. Fire questions in @SleeplessByte's direction, not mine, please, as I have no idea 🙂

Should we also do the same for v3-website?

Further test runner work to simplify

Docker Hub:

Nim tooling:

  • Build common Nim local web hook tooling and use that in single Dockerfiles to avoid the whole "-server" vs "-base" naming nightmare.
  • Get nim hook to build automagically
  • Migrate to nim hook, test with whole stack.

The master branch will be renamed to main

In line with our new org-wide policy, the master branch of this repo will be renamed to main. All open PRs will be automatically repointed.

GitHub will show you a notification about this when you look at this repo after renaming:

Screenshot 2021-01-27 at 15 31 45

In case it doesn't, this is the command it suggests:

git branch -m master main
git fetch origin
git branch -u origin/main main

You may like to update the primary branch on your forks too, which you can do under Settings->Branches and clicking the pencil icon on the right-hand-side under Default Branch:

Screenshot 2021-01-27 at 18 50 08

We will post a comment below when this is done. We expect it to happen within the next 12 hours.

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.