Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a new way to pre-fill disk storage #1747

Merged
merged 2 commits into from
Dec 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions docs/content/configuration/prefill-disk-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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
alex-user-go marked this conversation as resolved.
Show resolved Hide resolved

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.

Expand All @@ -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 <code>goget.sh</code> 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.
Expand Down