From 6da55680810fab6750c3b6d378911f9528431a7f Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 23 Dec 2021 00:46:16 +0300 Subject: [PATCH] a new way to pre-fill disk storage (#1747) * a new way to pre-fill disk storage * changed a headline to a bold'ed text --- .../configuration/prefill-disk-cache.md | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/content/configuration/prefill-disk-cache.md b/docs/content/configuration/prefill-disk-cache.md index 66ee9a52..a977d3a3 100644 --- a/docs/content/configuration/prefill-disk-cache.md +++ b/docs/content/configuration/prefill-disk-cache.md @@ -18,7 +18,9 @@ You'll need to produce the following assets from module source code: The `source.zip` file has a specific directory structure and the `$VERSION.info` has a JSON structure, both of which you'll need to get right in order for Athens to serve up the right dependency formats that the Go toolchain will accept. ->We don't recommend that you create these assets yourself. Instead, use [pacmod](https://github.com/plexsystems/pacmod) +>We don't recommend that you create these assets yourself. Instead, use [pacmod](https://github.com/plexsystems/pacmod) or [gopack](https://github.com/alex-user-go/gopack) + +## Using pacmod To install the `pacmod` tool, run `go get` like this: @@ -28,7 +30,7 @@ $ go get github.com/plexsystems/pacmod This command will install the `pacmod` binary to your `$GOPATH/bin/pacmod` directory, so make sure that is in your `$PATH`. -# Next, run `pacmod` to create assets +**Next, run `pacmod` to create assets** After you have `pacmod`, you'll need the module source code that you want to package. Before you run the command, set the `VERSION` variable in your environment to the version of the module you want to generate assets for. @@ -52,6 +54,28 @@ Once this command is done, you'll notice three new files in the same same direct - `$VERSION.info` - `$VERSION.zip` +## Using gopack + +>To use this method you need docker-compose installed. + +Fork gopack project and clone it to your local machine (or just download files to your computer) + +Edit goget.sh with a list of go modules you want to download: + +```bash +#!/bin/bash +go get github.com/my/module1; +go get github.com/my/module2; +``` + +Run + +```bash +docker-compose up --abort-on-container-exit +``` + +Once this command is done, you'll notice in the ATHENS_STORAGE folder all modules ready to be moved to your Athens disk storage. + # Next, move assets into Athens storage directory Now that you have assets built, you need to move them into the location of the Athens disk storage. In the below commands, we'll assume `$STORAGE_ROOT` is the environment variable that points to the top-level directory that Athens uses for its on-disk.