Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--Makefile2
-rw-r--r--README.md3
-rwxr-xr-x_support/install-protoc18
-rw-r--r--_support/package/Gemfile (renamed from _package/Gemfile)0
-rw-r--r--_support/package/Gemfile.lock (renamed from _package/Gemfile.lock)0
-rwxr-xr-x_support/package/package (renamed from _package/package)0
-rw-r--r--cmd/gitaly/main.go2
-rw-r--r--doc/img/img/rugged-new-timings.png (renamed from design/img/rugged-new-timings.png)bin263827 -> 263827 bytes
-rw-r--r--internal/helper/helper.go (renamed from helper/helper.go)0
-rw-r--r--internal/router/home.go (renamed from router/home.go)0
-rw-r--r--internal/router/home_test.go (renamed from router/home_test.go)0
-rw-r--r--internal/router/info_refs.go (renamed from router/info_refs.go)2
-rw-r--r--internal/router/info_refs_test.go (renamed from router/info_refs_test.go)0
-rw-r--r--internal/router/router.go (renamed from router/router.go)0
15 files changed, 20 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
index e95e8a3cb..e350be0c0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,8 @@
-/client/testdata/data
/_build
/gitaly
-/gitaly-client
/*.deb
-/_package/bin
-/_package/.bundle/
+/_support/package/bin
+/_support/package/.bundle/
/_support/protoc
/_support/bin
/_support/.bundle
diff --git a/Makefile b/Makefile
index 29ea25e4e..773492670 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ fmt:
_support/gofmt-all -n | awk '{ print } END { if (NR > 0) { print "Please run _support/gofmt-all -f"; exit 1 } }'
package: build
- ./_package/package ${CMDS}
+ ./_support/package/package ${CMDS}
clean: clean-build
rm -rf client/testdata
diff --git a/README.md b/README.md
index cf13cffb8..79c934a70 100644
--- a/README.md
+++ b/README.md
@@ -59,7 +59,7 @@ For GitLab.com the [git access is slow](https://gitlab.com/gitlab-com/infrastruc
When looking at `Rugged::Repository.new` performance data we can see that our P99 spikes up to 30 wall seconds, while the CPU time keeps in the realm of the 15 milliseconds. Pointing at filesystem access as the culprit.
-![rugged.new timings](design/img/rugged-new-timings.png)
+![rugged.new timings](doc/img/rugged-new-timings.png)
Our P99 access time to just create a Rugged::Repository object, which is loading and processing the git objects from disk, spikes over 30 seconds, making it basically unusable. We also saw that just walking through the branches of gitlab-ce requires 2.4 wall seconds.
@@ -104,6 +104,7 @@ All design decision should be added here.
1. Use [gRPC](http://www.grpc.io/) instead of HTTP+JSON. Not so much for performance reasons (Protobuf is faster than JSON) but because gRPC is an RPC framework. With HTTP+JSON we have to invent our own framework; with gRPC we get a set of conventions to work with. This will allow us to move faster once we have learned how to use gRPC.
1. All protocol definitions and auto-generated gRPC client code will be in the gitaly repo. We can include the client code from the rest of the application as a Ruby gem / Go package / client executable as needed. This will make cross-repo versioning easier.
1. Gitaly will expose high-level Git operations, not low-level Git object/ref storage lookups. Many interesting Git operations involve an unbounded number of Git object lookups. For example, the number of Git object lookups needed to generate a diff depends on the number of changed files and how deep those files are in the repository directory structure. It is not feasible to make each of those Git object lookups a remote procedure call.
+1. By default all Go packages in the Gitaly repository use the /internal directory, unless we explicitly want to export something. The only exception is the /cmd directory for executables.
## Iterate
diff --git a/_support/install-protoc b/_support/install-protoc
index c202085c4..3ed01e4da 100755
--- a/_support/install-protoc
+++ b/_support/install-protoc
@@ -9,19 +9,24 @@ PROTOC_DOWNLOAD = {
'url' => 'https://github.com/google/protobuf/releases/download/v3.1.0/protoc-3.1.0-osx-x86_64.zip',
'sha256' => '2cea7b1acb86671362f7aa554a21b907d18de70b15ad1f68e72ad2b50502920e',
},
+ 'linux' => {
+ 'url' => 'https://github.com/google/protobuf/releases/download/v3.1.0/protoc-3.1.0-linux-x86_64.zip',
+ 'sha256' => '7c98f9e8a3d77e49a072861b7a9b18ffb22c98e37d2a80650264661bfaad5b3a',
+ }
}
PROTOC_DIR = '_support/protoc'
def main
- if !osx?
+ current_platform = platform
+ unless current_platform
abort "Platform #{RUBY_PLATFORM} is not yet supported by #{$0}"
end
# protoc Protobuf compiler
- fetch_protoc(PROTOC_DOWNLOAD['osx'])
+ fetch_protoc(PROTOC_DOWNLOAD[current_platform])
FileUtils.rm_rf(PROTOC_DIR)
FileUtils.mkdir_p(PROTOC_DIR)
- run!(%W[unzip #{File.expand_path(File.basename(PROTOC_DOWNLOAD['osx']['url']))}], PROTOC_DIR)
+ run!(%W[unzip #{File.expand_path(File.basename(PROTOC_DOWNLOAD[current_platform]['url']))}], PROTOC_DIR)
# Go-specific libraries
%w[proto protoc-gen-go].each do |pkg|
@@ -31,8 +36,11 @@ def main
run!(%w[bundle install --binstubs], '_support')
end
-def osx?
- /darwin/ =~ RUBY_PLATFORM
+def platform
+ case RUBY_PLATFORM
+ when /darwin/ then 'osx'
+ when /linux/ then 'linux'
+ end
end
def fetch_protoc(source)
diff --git a/_package/Gemfile b/_support/package/Gemfile
index cf5bae70e..cf5bae70e 100644
--- a/_package/Gemfile
+++ b/_support/package/Gemfile
diff --git a/_package/Gemfile.lock b/_support/package/Gemfile.lock
index 9eac985a8..9eac985a8 100644
--- a/_package/Gemfile.lock
+++ b/_support/package/Gemfile.lock
diff --git a/_package/package b/_support/package/package
index cc9ef8cab..cc9ef8cab 100755
--- a/_package/package
+++ b/_support/package/package
diff --git a/cmd/gitaly/main.go b/cmd/gitaly/main.go
index 356669f35..bb0086cfe 100644
--- a/cmd/gitaly/main.go
+++ b/cmd/gitaly/main.go
@@ -9,7 +9,7 @@ import (
"github.com/kelseyhightower/envconfig"
"github.com/prometheus/client_golang/prometheus/promhttp"
- "gitlab.com/gitlab-org/gitaly/router"
+ "gitlab.com/gitlab-org/gitaly/internal/router"
)
type Config struct {
diff --git a/design/img/rugged-new-timings.png b/doc/img/img/rugged-new-timings.png
index 33e0d7d4b..33e0d7d4b 100644
--- a/design/img/rugged-new-timings.png
+++ b/doc/img/img/rugged-new-timings.png
Binary files differ
diff --git a/helper/helper.go b/internal/helper/helper.go
index 9886afd69..9886afd69 100644
--- a/helper/helper.go
+++ b/internal/helper/helper.go
diff --git a/router/home.go b/internal/router/home.go
index 54d09d3c0..54d09d3c0 100644
--- a/router/home.go
+++ b/internal/router/home.go
diff --git a/router/home_test.go b/internal/router/home_test.go
index d947d60dc..d947d60dc 100644
--- a/router/home_test.go
+++ b/internal/router/home_test.go
diff --git a/router/info_refs.go b/internal/router/info_refs.go
index 2f5db24d3..b3cab9a50 100644
--- a/router/info_refs.go
+++ b/internal/router/info_refs.go
@@ -8,7 +8,7 @@ import (
"os/exec"
"syscall"
- "gitlab.com/gitlab-org/gitaly/helper"
+ "gitlab.com/gitlab-org/gitaly/internal/helper"
"github.com/gorilla/mux"
)
diff --git a/router/info_refs_test.go b/internal/router/info_refs_test.go
index fc280bbe3..fc280bbe3 100644
--- a/router/info_refs_test.go
+++ b/internal/router/info_refs_test.go
diff --git a/router/router.go b/internal/router/router.go
index 29e214f81..29e214f81 100644
--- a/router/router.go
+++ b/internal/router/router.go