Commit Graph

948 Commits

Author SHA1 Message Date
DrPsychick
ac35a44e5a feat: new home for athens chart (#1845) 2023-03-14 07:08:18 +02:00
Nicholas Wiersma
fe1e4007eb chore: keep github actions up-to-date (#1835) 2023-03-14 07:00:01 +02:00
Manu Gupta
16644cb6d1 update dependencies x/net and aws sdk (#1854) 2023-03-13 20:52:17 -07:00
dependabot[bot]
511fb11e50 update-go-pkg(deps): bump github.com/google/go-cmp from 0.5.8 to 0.5.9 (#1846)
Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.8 to 0.5.9.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.5.8...v0.5.9)

---
updated-dependencies:
- dependency-name: github.com/google/go-cmp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-13 10:55:01 +02:00
Manu Gupta
4b0169ce38 Update alpine to 3.17 and build smaller binary. (#1850)
This PR updates alpine to 3.17 and builds smaller athens binary.
By using these flags; we are saving around 14M in athens binary
size.
2023-03-13 10:37:00 +02:00
Nicholas Wiersma
47404b0591 chore: fix ci build (#1853)
Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2023-03-13 10:23:44 +02:00
dependabot[bot]
d663c255ac Bump golang.org/x/crypto from 0.0.0-20211108221036-ceb1ce70b4fa to 0.1.0 (#1848) 2023-03-13 00:27:43 -07:00
Manu Gupta
aff0806204 fix workflow not running (#1852) 2023-03-12 23:12:07 -07:00
Nicholas Wiersma
986c3da1dc chore: use builtin action linter package (#1836)
* chore: use builtin action linter package

* fix: skip caches in golangci-lint

---------

Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2023-03-12 23:11:46 -07:00
Manu Gupta
d2dbaeabf8 Remove duplicate runs of all the workflows (#1851)
* Remove duplicate runs of all the workflows

* re-run workflows on merge to master
2023-03-12 23:00:45 -07:00
dependabot[bot]
f7e7b14484 Bump golang.org/x/net from 0.0.0-20220425223048-2871e0cb64e4 to 0.7.0 (#1847)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20220425223048-2871e0cb64e4 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-12 22:28:12 -07:00
Nicholas Wiersma
4090b0620a feat: update to Go 1.20 (#1838)
Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2023-03-12 22:12:39 -07:00
Zhongpeng Lin
b72a768a05 use errors.AsErr (#1849)
Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2023-03-12 22:04:12 -07:00
Nicholas Wiersma
96f7cb8975 feat: add non-root user to docker image (#1843) 2023-03-08 20:13:01 -08:00
Zhongpeng Lin
5099b30ac6 Removing Exists() check from S3 getters (#1842)
* Atomic access to S3

* fixing linting errors

* make delete return KindNotFound

* restore checker and deleter
2023-03-03 19:46:09 -08:00
Zhongpeng Lin
1f0a460687 Calling HeadObjectWithContext() concurrently to check the existence of a module (#1844)
* Using HeadObject to check the existence of a module

* fixing build

* calling cancel before closing channel

* fixing test

* using waitgroup

* calling cancel

* calling wg.Done

* only return the first error

* Revert "only return the first error"

This reverts commit c0aa18b522.

* clean err if not exist
2023-03-03 14:56:12 -05:00
Nicholas Wiersma
748aa4d165 chore: remove last drone remains (#1839)
* chore: remove drone

* fix: cr suggestions

* fix: cr suggestions
2023-02-28 18:51:12 +08:00
dependabot[bot]
af82a7a9cd update-go-pkg(deps): bump github.com/google/uuid from 1.1.2 to 1.3.0 (#1822)
Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.1.2 to 1.3.0.
- [Release notes](https://github.com/google/uuid/releases)
- [Commits](https://github.com/google/uuid/compare/v1.1.2...v1.3.0)

---
updated-dependencies:
- dependency-name: github.com/google/uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-02-28 13:17:04 +08:00
Manu Gupta
203c906fcb Update codeql action (#1834)
* move to github actions from drone (#1823)

* add github actions workflow for tag releases

* migrate drone build &test step to github actions

* fix minio service

* fix indentation

* fix dependency syntax

* remove needs keyword

* fix service hostnames, add protectedredis

* update protected redis docker image

* fix too many args error

* exclude vendor dir from gofmt

* fix fmt errors

* fix fmt errors

* rm .drone.yml

* rename workflow name

* break test step

* remove vendor step

* use makefile rule

* use buildx

* Update codeql

---------

Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-02-27 18:08:18 +08:00
dependabot[bot]
c4dec51b01 Bump github.com/aws/aws-sdk-go from 1.33.0 to 1.34.0 (#1824)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.33.0 to 1.34.0.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/v1.34.0/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.33.0...v1.34.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-02-27 18:07:55 +08:00
dependabot[bot]
257bb752fb Bump github.com/prometheus/client_golang from 1.11.0 to 1.11.1 (#1825)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.11.0 to 1.11.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.11.0...v1.11.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-02-26 14:38:51 +05:30
Ashish Ranjan
9a1a7707f3 fix release workflow (#1831)
* fix release workflow

* test release

* remove test changes

* add version tag to release workflow

---------

Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2023-02-25 17:53:59 +05:30
Nicholas Wiersma
d932d50232 chore: lint code with golangci-lint (#1828)
* feat: add golangci-lint linting

* chore: fix linter issues

* feat: add linting into the workflow

* docs: update lint docs

* fix: cr suggestions

* fix: remove old formatting and vetting scripts

* fix: add docker make target

* fix: action go caching

* fix: depreciated actions checkout version

* fix: cr suggestion

* fix: cr suggestions

---------

Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2023-02-24 20:39:17 -08:00
dependabot[bot]
66582eebfe Bump golang.org/x/text from 0.3.7 to 0.3.8 (#1829)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.3.7...v0.3.8)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-24 20:02:24 -08:00
Ashish Ranjan
3f26845cff move to github actions from drone (#1823)
* add github actions workflow for tag releases

* migrate drone build &test step to github actions

* fix minio service

* fix indentation

* fix dependency syntax

* remove needs keyword

* fix service hostnames, add protectedredis

* update protected redis docker image

* fix too many args error

* exclude vendor dir from gofmt

* fix fmt errors

* fix fmt errors

* rm .drone.yml

* rename workflow name

* break test step

* remove vendor step

* use makefile rule

* use buildx
2023-02-22 22:47:37 -08:00
DrPsychick
dbe3b5d145 fix: only update chart README (#1820) 2023-02-07 18:41:09 -08:00
Rob Prentiss
23bfcd19bc Update lib/pq to fix cert permissions issues (#1804)
When attempting to connect to a PostgreSQL database using certificate
credentials, authentication may fail due to permissions issues on the
certificate files. When using Athens in Kubernetes, this issue may be
unavoidable when using secrets.

The github.com/lib/pq library has resolved this issue as of v1.10.6, so
this commit updates that library to the latest release version (v1.10.7)
to resolve the issue in Athens.

Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-01-30 13:49:43 +08:00
dependabot[bot]
4b93ee76a2 update-go-pkg(deps): bump golang.org/x/mod from 0.4.2 to 0.7.0 (#1800)
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.4.2 to 0.7.0.
- [Release notes](https://github.com/golang/mod/releases)
- [Commits](https://github.com/golang/mod/compare/v0.4.2...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-01-30 13:38:48 +08:00
Zhongpeng Lin
6aaf9e5b17 Handle duplicate keys returned by S3 ListObject (#1793)
S3 API sometimes returns duplicate keys, causing the number of file for a specific module greater than 3. This PR makes Athens handle that situation gracefully and log a warning message instead of treating the module as not found.

logging string content

Co-authored-by: Manu Gupta <manugupt1@gmail.com>
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-01-30 13:01:09 +08:00
Eng Zer Jun
b3bc773e29 test(pkg/config): use t.Setenv to set env vars (#1821)
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-01-30 13:00:37 +08:00
dependabot[bot]
4a1ff03860 Bump github.com/aws/aws-sdk-go from 1.32.7 to 1.33.0 (#1810)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.32.7 to 1.33.0.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/v1.33.0/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.32.7...v1.33.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-01-30 12:44:21 +08:00
Mike Seplowitz
f35a5406a3 Pass Athens's logger to the Redis package (#1817)
Co-authored-by: Ashish Ranjan <ashishranjan2912@gmail.com>
2023-01-30 12:22:49 +08:00
Nicholas Wiersma
ab64133949 feat: replace ioutil with io and os (#1816) 2023-01-27 20:42:47 +05:30
Rob Prentiss
6baf7c9033 Handle SIGTERM on unix-like OS (#1805) 2023-01-24 18:04:56 -08:00
Rob Prentiss
a1553999bb Make shutdown timeout configurable (#1806)
Currently, when shutting down the server (via SIGINT or SIGTERM), the
shutdown closes any open connections after only 10 seconds (via a
context.WithTimeout). This does not provie a lot of time for longer
operations, such as listing versions, or downloading a larger module zip
file.

When running in Kubernetes, and scaling instances or changing config,
this causes a lot of dropped connections and gateway errors. 10 seconds
is arguably much too short, and should be configurable.

This commit increases that default to 60 seconds, and adds a config
variable to allow users to specify their desired timeout.
2023-01-23 22:02:45 -08:00
Ashish Ranjan
b7dd8a85de upgrade go version to 1.19 (#1814)
* upgrade go version to 1.19

* update base image
2023-01-19 22:32:08 -08:00
Zhongpeng Lin
4c3443328e Adding new fields to RevInfo (#1812)
* Allow unknown fields in RevInfo

* Revert "Allow unknown fields in RevInfo"

This reverts commit 902d791554.

* Adding new fields to rev_info.go

* fixed tests
2023-01-16 12:11:10 -08:00
Jerry Ng
92150d0500 Update s3 checker to iterate through all objects pages (#1802) 2023-01-08 13:46:20 -08:00
Ashish Ranjan
cc496afbf1 read redis lock options from config to support custom TTL & timeout (#1791)
* read redis lock options from config to support custom TTL & timeout

* fix test

* fix typo

* downgrade to bsm/redislock@v0.7.2 to prevent usage of beta go-redis version

* revert test changes

* return error for invalid lock config

* update config parsing test

* udpate docs to include redis lock config

* fix test

* set default max retries to 10

* reduce default redis lock timeout to 15s

* update default TTL to 15mins

Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2022-09-28 22:53:06 -07:00
Zhongpeng Lin
b8d7c4aa79 Register HTTP client views for stats (#1787) 2022-09-22 21:04:51 -07:00
Ashish Ranjan
7d67ee76ce fix default s3 credentials set as anonymous (#1789) 2022-09-15 18:30:54 -07:00
Ashish Ranjan
33777c5cc4 copy context before starting stash operations to prevent ctx cancellations (#1790)
* copy context before starting stash operations to prevent ctx cancellations

* add comment about context cancellation
2022-09-15 11:03:59 -04:00
Zhongpeng Lin
e97cb5f5df Passing http client to S3 client (#1786) 2022-08-26 09:03:56 -04:00
Rski
3234d1b100 remove checked in main binary (#1782)
This looks accidentally checked it. The commit can't erase it from
the repo itself, but there is no point in having it there
2022-08-09 15:44:04 -07:00
Zhongpeng Lin
adccf1534d regrouping go.mod (#1781) 2022-08-03 20:42:41 -07:00
JefM
085e294d23 build releases for x86_64 (#1779) 2022-06-17 10:11:24 -04:00
Rob Prentiss
3fab46905e Resolve memory leaks when using Minio storage (#1777)
When using Minio storage, memory usage constantly increases. After
profiling, it appears that memory usage is building in the minio client,
and not being released.

Finding a similar issue listed in the minio/warp project, I found that
they fixed the issue by closing the *minio.Object instances. In the
athens usage, the minio.Object instances are never closed after reading
the data from them.

This adds deferred 'Close' calls in the 'storageImpl.Info' and
'storageImpl.GoMod' functions so that the objects may be released and
garbage collected. The 'storageImpl.Zip' function does not use defer,
since it has the object embedded into the return value, so the 'Close'
is only called on error.
2022-06-06 19:04:33 -04:00
dependabot[bot]
b03db41dfb update-go-pkg(deps): bump github.com/minio/minio-go/v6 (#1770)
Bumps [github.com/minio/minio-go/v6](https://github.com/minio/minio-go) from 6.0.43 to 6.0.57.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v6.0.43...v6.0.57)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2022-06-03 21:30:04 -07:00
Qiu Yuzhou
723c06bd8c chore(chart): update ingress to support apiVersion networking.k8s.io/v1 (#1769)
* chore(chart): update ingress to support apiVersion networking.k8s.io/v1

* refactor(chart): use API capabilities instead version comparisions in ingress

Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2022-04-18 20:28:13 -07:00
dependabot[bot]
f381187453 update-go-pkg(deps): bump github.com/go-sql-driver/mysql (#1767)
Bumps [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/go-sql-driver/mysql/releases)
- [Changelog](https://github.com/go-sql-driver/mysql/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-sql-driver/mysql/compare/v1.5.0...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/go-sql-driver/mysql
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Manu Gupta <manugupt1@gmail.com>
2022-03-31 22:36:01 -07:00