diff --git a/.circleci/config.yml b/.circleci/config.yml index a9319248b..ddb7037f0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,9 +43,9 @@ jobs: - run: name: Upgrade Go command: | - wget https://golang.org/dl/go1.22.0.linux-arm64.tar.gz + wget https://golang.org/dl/go1.23.0.linux-arm64.tar.gz sudo rm -rf /usr/local/go - sudo tar -C /usr/local -xzf go1.22.0.linux-arm64.tar.gz + sudo tar -C /usr/local -xzf go1.23.0.linux-arm64.tar.gz - restore_cache: keys: - go-mod-v4-{{ checksum "go.sum" }} diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index a2e615afb..e16f1c8ea 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -9,10 +9,10 @@ jobs: name: build binaries runs-on: ubuntu-latest steps: - - name: Set up Go 1.22.x + - name: Set up Go 1.23.x uses: actions/setup-go@v4 with: - go-version: 1.22.x + go-version: 1.23.x id: go - name: Pull source diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 8494d7a16..7fefe409a 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -73,10 +73,10 @@ jobs: unzip ~/.gorse/download/ml-tag.zip -d ~/.gorse/dataset unzip ~/.gorse/download/criteo.zip -d ~/.gorse/dataset - - name: Set up Go 1.22.x + - name: Set up Go 1.23.x uses: actions/setup-go@v4 with: - go-version: 1.22.x + go-version: 1.23.x id: go - name: Check out code into the Go module directory @@ -126,7 +126,7 @@ jobs: database=${{ matrix.database }} - name: Build the stack - run: docker-compose -f client/docker-compose.yml --project-directory . up -d + run: docker compose -f client/docker-compose.yml --project-directory . up -d env: DOCKER_BUILDKIT: 1 @@ -142,10 +142,10 @@ jobs: # Retry all errors, including 404. This option might trigger curl upgrade. retry-all: true - - name: Set up Go 1.22.x + - name: Set up Go 1.23.x uses: actions/setup-go@v4 with: - go-version: 1.22.x + go-version: 1.23.x id: go - name: Test @@ -172,10 +172,10 @@ jobs: MYSQL_ROOT_PASSWORD: password steps: - - name: Set up Go 1.22.x + - name: Set up Go 1.23.x uses: actions/setup-go@v4 with: - go-version: 1.22.x + go-version: 1.23.x id: go - name: Check out code into the Go module directory @@ -192,7 +192,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: 1.22.x + go-version: 1.23.x - uses: actions/checkout@v2 - name: golangci-lint uses: golangci/golangci-lint-action@v2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index efb159339..f2d0a0ec6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,7 @@ These following installations are required: ```bash cd storage -docker-compose up -d +docker compose up -d ``` If you need import sample data, download the SQL file github.sql and import to the MySQL instance. diff --git a/README.md b/README.md index 8190f5e58..76036f114 100644 --- a/README.md +++ b/README.md @@ -1,123 +1,2 @@ -# Gorse Recommender System Engine - - - -![](https://img.shields.io/github/go-mod/go-version/zhenghaoz/gorse) -[![build](https://github.com/zhenghaoz/gorse/workflows/build/badge.svg)](https://github.com/zhenghaoz/gorse/actions?query=workflow%3Abuild) -[![codecov](https://codecov.io/gh/gorse-io/gorse/branch/master/graph/badge.svg)](https://codecov.io/gh/gorse-io/gorse) -[![Go Report Card](https://goreportcard.com/badge/github.com/zhenghaoz/gorse)](https://goreportcard.com/report/github.com/zhenghaoz/gorse) -[![GoDoc](https://godoc.org/github.com/zhenghaoz/gorse?status.svg)](https://godoc.org/github.com/zhenghaoz/gorse) -[![Discord](https://img.shields.io/discord/830635934210588743)](https://discord.gg/x6gAtNNkAE) -[![Twitter Follow](https://img.shields.io/twitter/follow/gorse_io?label=Follow&style=social)](https://twitter.com/gorse_io) - -Gorse is an open-source recommendation system written in Go. Gorse aims to be a universal open-source recommender system that can be quickly introduced into a wide variety of online services. By importing items, users, and interaction data into Gorse, the system will automatically train models to generate recommendations for each user. Project features are as follows. - - - -- **Multi-source:** Recommend items from Popular, latest, user-based, item-based and collaborative filtering. -- **AutoML:** Search the best recommendation model automatically in the background. -- **Distributed prediction:** Support horizontal scaling in the recommendation stage after single node training. -- **RESTful APIs:** Expose RESTful APIs for data CRUD and recommendation requests. -- **Online evaluation:** Analyze online recommendation performance from recently inserted feedback. -- **Dashboard:** Provide GUI for data management, system monitoring, and cluster status checking. - -## Quick Start - -The playground mode has been prepared for beginners. Just set up a recommender system for GitHub repositories by the following commands. - -- Linux/macOS: - -```bash -curl -fsSL https://gorse.io/playground | bash -``` - -- Docker: - -```bash -docker run -p 8088:8088 zhenghaoz/gorse-in-one --playground -``` - -The playground mode will download data from [GitRec](https://gitrec.gorse.io/) and import it into Gorse. The dashboard is available at `http://localhost:8088`. - - - -After the "Find neighbors of items" task is completed on the "Tasks" page, try to insert several feedbacks into Gorse. Suppose Bob is a frontend developer who starred several frontend repositories in GitHub. We insert his star feedback to Gorse. - -```bash -read -d '' JSON << EOF -[ - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"vuejs:vue\", \"Timestamp\": \"2022-02-24\" }, - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"d3:d3\", \"Timestamp\": \"2022-02-25\" }, - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"dogfalo:materialize\", \"Timestamp\": \"2022-02-26\" }, - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"mozilla:pdf.js\", \"Timestamp\": \"2022-02-27\" }, - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"moment:moment\", \"Timestamp\": \"2022-02-28\" } -] -EOF - -curl -X POST http://127.0.0.1:8088/api/feedback \ - -H 'Content-Type: application/json' \ - -d "$JSON" -``` - -Then, fetch 10 recommended items from Gorse. We can find that frontend-related repositories are recommended for Bob. - -```bash -curl http://127.0.0.1:8088/api/recommend/bob?n=10 -``` - -
-Example outputs: - -```json -[ - "mbostock:d3", - "nt1m:material-framework", - "mdbootstrap:vue-bootstrap-with-material-design", - "justice47:f2-vue", - "10clouds:cyclejs-cookie", - "academicpages:academicpages.github.io", - "accenture:alexia", - "addyosmani:tmi", - "1wheel:d3-starterkit", - "acdlite:redux-promise" -] -``` - -
- -> The exact output might be different from the example since the playground dataset changes over time. - -For more information: - -- Read [official documents](https://gorse.io/docs/master) -- Visit [official demo](https://gitrec.gorse.io/) -- Discuss on [Discord](https://discord.gg/x6gAtNNkAE) or [GitHub Discussion](https://github.com/gorse-io/gorse/discussions) - -## Architecture - -Gorse is a single-node training and distributed prediction recommender system. Gorse stores data in MySQL, MongoDB, or Postgres, with intermediate results cached in Redis, MySQL, MongoDB and Postgres. - -1. The cluster consists of a master node, multiple worker nodes, and server nodes. -1. The master node is responsible for model training, non-personalized item recommendation, configuration management, and membership management. -1. The server node is responsible for exposing the RESTful APIs and online real-time recommendations. -1. Worker nodes are responsible for offline recommendations for each user. - -In addition, the administrator can perform system monitoring, data import and export, and system status checking via the dashboard on the master node. - - - -## Contributors - - - - - -Any contribution is appreciated: report a bug, give advice or create a pull request. Read [CONTRIBUTING.md](CONTRIBUTING.md) for more information. - -## Acknowledgments - -`gorse` is inspired by the following projects: - -- [Guibing Guo's librec](https://github.com/guoguibing/librec) -- [Nicolas Hug's Surprise](https://github.com/NicolasHug/Surprise) -- [Golang Samples's gopher-vector](https://github.com/golang-samples/gopher-vector) +> [!CAUTION] +> Still in development. Not ready for production use. diff --git a/client/README.md b/client/README.md index db5ab3524..3e10c712d 100644 --- a/client/README.md +++ b/client/README.md @@ -35,7 +35,7 @@ In the root directory of Gorse source: ```bash # Setup Gorse -docker-compose up -d +docker compose up -d # Test go test -tags='integrate_test' ./client/ diff --git a/cmd/gorse-in-one/Dockerfile b/cmd/gorse-in-one/Dockerfile index 657604aa1..ec67c69ed 100644 --- a/cmd/gorse-in-one/Dockerfile +++ b/cmd/gorse-in-one/Dockerfile @@ -1,7 +1,7 @@ ############################ # STEP 1 build executable binary ############################ -FROM golang:1.22 +FROM golang:1.23 COPY . gorse diff --git a/cmd/gorse-in-one/Dockerfile.windows b/cmd/gorse-in-one/Dockerfile.windows index 7027ba62a..411366afe 100644 --- a/cmd/gorse-in-one/Dockerfile.windows +++ b/cmd/gorse-in-one/Dockerfile.windows @@ -1,7 +1,7 @@ ############################ # STEP 1 build executable binary ############################ -FROM golang:1.22 +FROM golang:1.23 COPY . gorse diff --git a/cmd/gorse-master/Dockerfile b/cmd/gorse-master/Dockerfile index 34dc3323d..d25ed7069 100644 --- a/cmd/gorse-master/Dockerfile +++ b/cmd/gorse-master/Dockerfile @@ -3,7 +3,7 @@ ############################ # STEP 1 build executable binary ############################ -FROM golang:1.22 +FROM golang:1.23 WORKDIR /src diff --git a/cmd/gorse-master/Dockerfile.windows b/cmd/gorse-master/Dockerfile.windows index a259cebf0..cef6fba43 100644 --- a/cmd/gorse-master/Dockerfile.windows +++ b/cmd/gorse-master/Dockerfile.windows @@ -1,7 +1,7 @@ ############################ # STEP 1 build executable binary ############################ -FROM golang:1.22 +FROM golang:1.23 COPY . gorse diff --git a/cmd/gorse-server/Dockerfile b/cmd/gorse-server/Dockerfile index 4e58ec6f4..326e87d45 100644 --- a/cmd/gorse-server/Dockerfile +++ b/cmd/gorse-server/Dockerfile @@ -3,7 +3,7 @@ ############################ # STEP 1 build executable binary ############################ -FROM golang:1.22 +FROM golang:1.23 WORKDIR /src diff --git a/cmd/gorse-server/Dockerfile.windows b/cmd/gorse-server/Dockerfile.windows index 407ea851e..6e37ce7bf 100644 --- a/cmd/gorse-server/Dockerfile.windows +++ b/cmd/gorse-server/Dockerfile.windows @@ -1,7 +1,7 @@ ############################ # STEP 1 build executable binary ############################ -FROM golang:1.22 +FROM golang:1.23 COPY . gorse diff --git a/cmd/gorse-worker/Dockerfile b/cmd/gorse-worker/Dockerfile index 7a874e81f..814d21e7b 100644 --- a/cmd/gorse-worker/Dockerfile +++ b/cmd/gorse-worker/Dockerfile @@ -3,7 +3,7 @@ ############################ # STEP 1 build executable binary ############################ -FROM golang:1.22 +FROM golang:1.23 WORKDIR /src diff --git a/cmd/gorse-worker/Dockerfile.windows b/cmd/gorse-worker/Dockerfile.windows index c5888f146..80824c8ec 100644 --- a/cmd/gorse-worker/Dockerfile.windows +++ b/cmd/gorse-worker/Dockerfile.windows @@ -1,7 +1,7 @@ ############################ # STEP 1 build executable binary ############################ -FROM golang:1.22 +FROM golang:1.23 COPY . gorse