Contributing to Meshery Server
As a new contributor, youβre going to want to familiarize with the project in order to resolve the issues in the best way. Installing and playing around with Meshery will give you context for any issues that you might work on.
Once an issue has been addressed, youβll need to test it as well. Ideally, these tests are run from the userβs perspective (someone running Meshery in a container), not from a contributorβs perspective (someone running Meshery as a locally-compiled service).
Compiling and Running Meshery server
To build and run Meshery server from source:
- Build the static assets for the UI by running
make ui-setup make ui-build
- Build & run the server code by running
make server
Any time changes are made to the Go code, you will have to stop the server and run the above command again.
Once the Meshery server is up and running, you should be able to access Meshery on your localhost
on port 9081
at http://localhost:9081
. One thing to note, you might NOT see the Meshery UI until the UI code is built as well.
After running Meshery server, you will need to select your Cloud Provider by navigating to localhost:9081
. Only then you will be able to use the Meshery UI on port 3000
.
Please note: If you get error while starting the server as βMeshery Development Incompatibleβ then follow the below guideline π
Potential Solution:
-
Go to your meshery folder in your local-system where youβve cloned it. Execute:
git remote add upstream https://github.com/meshery/meshery
git fetch upstream
- Restart the meshery server
- Additionally, before restarting the server, if you like to pull the latest changes, you can do:
git pull upstream master
Building Docker image
To build a Docker image of Meshery, please ensure you have Docker
installed to be able to build the image. Now, run the following command to build the Docker image:
make docker
Define and validate errors
Every Golang-based component within the Meshery ecosystem incorporates a utility to define and manage error messages for every error instance. This is internally done with several make commands, but one can explicitly validate with the help of the following make command. This checks and validates the errors that are present in the particular project.
make error
For more details, Error Utility
Configuring Log levels at Runtime
The server log levels can be configured at runtime by changing the env variable LOG_LEVEL
defined in file server-config.env
. The configuration library (viper
) watches for the env file, any change in the file content results in the file_system
event to be emitted and the log level is updated accordingly.
Should there be any alterations to the location or name of the environment file, it will result in the inability to configure log levels during runtime. In the event of such modifications, it is essential to update the server to preserve proper functionality.
```Available Meshery Server log levels are:
- Panic - 0
- Fatal - 1
- Error - 2
- Warn - 3
- Info - 4
- Debug - 5
- Trace level - 6 ```
The default setting for the LOG_LEVEL
is 4
(Info). However, if the DEBUG
environmental variable is configured as TRUE
, it supersedes the value set in the LOG_LEVEL
environmental variable, and the logging level is then adjusted to 5
(Debug).
Using custom Meshkit code for Meshery server development
-
Checkout meshery and meshkit repository in adjacent directories.
$ git clone https://github.com/meshery/meshery.git $ git clone https://github.com/meshery/meshkit.git
-
In your
meshery
go.mod, update the meshkit package.github.com/layer5io/meshkit => ../meshkit
Remember to remove this go.mod change when creating pull requests.
Suggested Reading
- Build & Release (CI) - Details of Meshery's build and release strategy.
- Contributing to Meshery Adapters - How to contribute to Meshery Adapters
- Contributing to Meshery CLI - How to contribute to Meshery Command Line Interface.
- Contributing to Meshery's End-to-End Tests using Cypress - How to contribute to End-to-End Tests using Cypress.
- Contributing to Meshery Docker Extension - How to contribute to Meshery Docker Extension
- Contributing to Meshery Docs - How to contribute to Meshery Docs.
- How to write MeshKit compatible errors - How to declare errors in Meshery components.
- Contributing to Meshery using git - How to contribute to Meshery using git
- Meshery CLI Contributing Guidelines - Design principles and code conventions.
- Contributing to Model Components - How to contribute to Meshery Model Components
- Contributing to Model Relationships - How to contribute to Meshery Models Relationships, Policies...
- Contributing to Models Quick Start - A no-fluff guide to creating your own Meshery Models quickly.
- Contributing to Models - How to contribute to Meshery Models, Components, Relationships, Policies...
- Contributing to Meshery Policies - How to contribute to Meshery Policies
- Contributing to Meshery Server Events - Guide is to help backend contributors send server events using Golang.
- Contributing to Meshery UI - Notification Center - How to contribute to the Notification Center in Meshery's web-based UI.
- Contributing to Meshery UI - Sistent - How to contribute to the Meshery's web-based UI using sistent design system.
- Contributing to Meshery's End-to-End Tests - How to contribute to End-to-End Tests using Playwright.
- Contributing to Meshery UI - How to contribute to Meshery UI (web-based user interface).
- Setting up Meshery Development Environment on Windows - How to set up Meshery Development Environment on Windows