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

Checkout Standard Capabilities #15671

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 17 additions & 1 deletion .github/workflows/build-publish-develop-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,28 @@ jobs:
goarch: arm64
dist_name: linux_arm64_v8.0
steps:
- name: Checkout repository
- name: Checkout chainlink repository
uses: actions/[email protected]
with:
ref: ${{ env.CHECKOUT_REF }}
fetch-depth: 0

- name: Setup Github Token
justinkaseman marked this conversation as resolved.
Show resolved Hide resolved
id: token
uses: smartcontractkit/.github/actions/setup-github-token@ef78fa97bf3c77de6563db1175422703e9e6674f # [email protected]
with:
aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }}
aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }}
aws-region: ${{ secrets.AWS_REGION }}
set-git-config: "true"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set-git-config: "true"

I think we can remove this since you're using the token explicitly in the next step?


- name: Checkout capabilities repository
uses: actions/[email protected]
with:
repository: smartcontractkit/capabilities
token: ${{ steps.token.outputs.access-token }}
path: capabilities

- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
Expand Down
10 changes: 10 additions & 0 deletions tools/bin/goreleaser_utils
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ before_hook() {
install_local_plugins
install_remote_plugins
mkdir -p "$lib_path/plugins"
build_standard_capabilities
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to always include these plugins going forward versus making it optional? If so, this makes sense.


# Retrieve GOPATH
GOPATH=$(go env GOPATH)
Expand Down Expand Up @@ -71,6 +72,15 @@ get_remote_plugin_paths() {
done
}

build_standard_capabilities() {
cd ./capabilities
npx [email protected] init
./nx run-many -t build
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HenryNguyen5 @chainchad should I be using actions/cache to cache these binaries?

Copy link
Contributor Author

@justinkaseman justinkaseman Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also no manifest right now. Is a manifest necessary for phase 1? Or can it come with phase 2 as we harden?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYM by manifest?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setup-go action should already cache the intermediate artifacts to the binaries, if not the binaries themselves. Probably best to leave it as-is. If build times continue to be an issue, it's better to publish the binaries on the capabilities repo side then pull down the pre-built binaries in here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYM by manifest?

Originally @chainchad @cedric-cordenier and I talked about the first iteration of this having:

"
Some manifest file which has the plugin name, version, url, and checksum. For ex.

version: 1.0
dependencies:
- name: dependency1
version: 1.2.3
url: [https://example.com/dependency1/v1.2.3/dependency1.tar.gz](https://www.google.com/url?q=https://example.com/dependency1/v1.2.3/dependency1.tar.gz&sa=D&source=docs&ust=1734635936940744&usg=AOvVaw16wDn9XzQdSKoTtxHG6Po1)
checksum: sha256:abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890

"

But currently it just builds from the latest head in the capabilities repo without doing any checks

Copy link
Collaborator

@HenryNguyen5 HenryNguyen5 Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, makes sense. Ill leave this up to @chainchad

Copy link
Collaborator

@chainchad chainchad Dec 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't have a manifest, the implication is that we'll always build this with the latest standard capabilities? I suppose that's fine for this image which is a "develop" image. If we want to release this, I suppose we'll need that manifest then. Would that work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't have a manifest, the implication is that we'll always build this with the latest standard capabilities? I suppose that's fine for this image which is a "develop" image. If we want to release this, I suppose we'll need that manifest then. Would that work?

Yes. That plan sounds good to me.

# binaries get put into /bin under /bin/amd64/ and /bin/arm64/
cp "./bin/$(go env GOARCH)"/* "../$lib_path/plugins"
cd ../
}

install_remote_plugins() {
ldflags=(-ldflags "$(./tools/bin/ldflags)")

Expand Down
Loading