Skip to content

Commit

Permalink
chore(ci): consistent file types (#2341)
Browse files Browse the repository at this point in the history
use yamls

issue: none
  • Loading branch information
ttarsi authored Oct 31, 2024
1 parent 0d12e88 commit ac1f411
Show file tree
Hide file tree
Showing 43 changed files with 75 additions and 75 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions .github/workflows/ci-main.yml → .github/workflows/ci-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ permissions:

jobs:
pre-commit:
uses: ./.github/workflows/pre-commit.yml
uses: ./.github/workflows/pre-commit.yaml
go-tests:
uses: ./.github/workflows/gotest.yml
uses: ./.github/workflows/gotest.yaml
go-lint:
uses: ./.github/workflows/golangci-lint.yml
uses: ./.github/workflows/golangci-lint.yaml
sol-tests:
uses: ./.github/workflows/soltest.yml
uses: ./.github/workflows/soltest.yaml
cli-install:
uses: ./.github/workflows/cliinstall.yml
uses: ./.github/workflows/cliinstall.yaml
cli-command:
uses: ./.github/workflows/clicommand.yml
uses: ./.github/workflows/clicommand.yaml
release-snapshot:
uses: ./.github/workflows/release-snapshot.yml
uses: ./.github/workflows/release-snapshot.yaml
needs: [pre-commit, go-tests, go-lint, sol-tests]
secrets: inherit
e2e:
uses: ./.github/workflows/e2etest.yml
uses: ./.github/workflows/e2etest.yaml
needs: [release-snapshot]
e2e-test-admin:
uses: ./.github/workflows/e2etestadmin.yml
uses: ./.github/workflows/e2etestadmin.yaml
needs: [release-snapshot]
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions .github/workflows/ci-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: ci pr
# continuous integration on pull requests to main and release branches

on:
pull_request:
branches:
- main
- release/**
- upgrade/** # Run CI against upgrade PRs

permissions:
contents: read
pull-requests: write

jobs:
pre-commit:
uses: ./.github/workflows/pre-commit.yaml
go-tests:
uses: ./.github/workflows/gotest.yaml
go-lint:
uses: ./.github/workflows/golangci-lint.yaml
cli-install:
uses: ./.github/workflows/cliinstall.yaml
cli-command:
uses: ./.github/workflows/clicommand.yaml
sol-tests:
uses: ./.github/workflows/soltest.yaml
e2e-tests:
uses: ./.github/workflows/pr-e2etest.yaml
check-sol-artifacts:
uses: ./.github/workflows/check-sol-artifacts.yaml
pr-label:
uses: ./.github/workflows/pr-label.yaml
33 changes: 0 additions & 33 deletions .github/workflows/ci-pr.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ permissions:

jobs:
release-official:
uses: ./.github/workflows/release-official.yml
uses: ./.github/workflows/release-official.yaml
secrets: inherit
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repos:

# Then run code validators (on the formatted code)

- repo: https://github.com/golangci/golangci-lint # See .golangci.yml for config
- repo: https://github.com/golangci/golangci-lint # See .golangci.yaml for config
rev: v1.60.3
hooks:
- id: golangci-lint
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions cli/cmd/initnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (c InitConfig) Verify() error {
return c.Network.Verify()
}

//go:embed compose.yml.tpl
//go:embed compose.yaml.tpl
var composeTpl []byte

func newInitCmd() *cobra.Command {
Expand Down Expand Up @@ -184,7 +184,7 @@ func maybeDownloadGenesis(ctx context.Context, network netconf.ID) error {
}

func writeComposeFile(ctx context.Context, cfg InitConfig) error {
composeFile := filepath.Join(cfg.Home, "compose.yml")
composeFile := filepath.Join(cfg.Home, "compose.yaml")

if cmtos.FileExists(composeFile) {
log.Info(ctx, "Found existing compose file", "path", composeFile)
Expand Down Expand Up @@ -229,7 +229,7 @@ func writeComposeFile(ctx context.Context, cfg InitConfig) error {
return errors.Wrap(err, "writing compose file")
}

log.Info(ctx, "Generated docker compose file", "path", filepath.Join(cfg.Home, "compose.yml"), "geth_version", geth.Version, "halo_version", cfg.HaloTag)
log.Info(ctx, "Generated docker compose file", "path", filepath.Join(cfg.Home, "compose.yaml"), "geth_version", geth.Version, "halo_version", cfg.HaloTag)

return nil
}
Expand Down
6 changes: 3 additions & 3 deletions docs/content/operate/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The resulting `~/.omni/<network>` folder has the following structure:
~/.omni/<network>/ # Node home folder
├─ halo/ # Consensus client
├─ geth/ # Execution client
├─ compose.yml # Docker compose
├─ compose.yaml # Docker compose
```

It is a valid configuration for running a production Omni full node.
Expand Down Expand Up @@ -175,9 +175,9 @@ A path to this file (or copy of) must be provided in the `halo.toml` `engine-jwt

## Configure Docker Compose
The preferred way to run an Omni node is via Docker Compose as described in the [Run a Full Node](run-full-node.md#halo-deployment-options) docs.
The docker `compose.yml` file is located in `~/.omni/<network>/compose.yml`.
The docker `compose.yaml` file is located in `~/.omni/<network>/compose.yaml`.

Download the latest template `compose.yml` [here](https://github.com/omni-network/omni/blob/main/cli/cmd/compose.yml.tpl).
Download the latest template `compose.yaml` [here](https://github.com/omni-network/omni/blob/main/cli/cmd/compose.yaml.tpl).

Ensure the following template fields are replaced:
- `{{.HaloTag}}`: The latest `omniops/halovisor` docker image tag, e.g. `v0.99.0`, see [releases](https://github.com/omni-network/omni/releases)
Expand Down
4 changes: 2 additions & 2 deletions e2e/app/agent/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const (
gethPromPort = 6060
)

//go:embed prometheus.yml.tmpl
//go:embed prometheus.yaml.tmpl
var promConfigTmpl []byte

func WriteConfig(ctx context.Context, testnet types.Testnet, secrets Secrets) error {
Expand All @@ -43,7 +43,7 @@ func WriteConfig(ctx context.Context, testnet types.Testnet, secrets Secrets) er
return errors.Wrap(err, "generating prometheus config")
}

promFile := filepath.Join(testnet.Dir, "prometheus", "prometheus.yml")
promFile := filepath.Join(testnet.Dir, "prometheus", "prometheus.yaml")
if err := os.MkdirAll(filepath.Dir(promFile), 0755); err != nil {
return errors.Wrap(err, "creating prometheus dir")
}
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions e2e/docker/compose.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ services:
container_name: prometheus
image: prom/prometheus:latest
command:
- --config.file=/etc/prometheus/prometheus.yml
- --config.file=/etc/prometheus/prometheus.yaml
- --web.console.libraries=/usr/share/prometheus/console_libraries
- --web.console.templates=/usr/share/prometheus/consoles
- --enable-feature=exemplar-storage
- --enable-feature=agent
restart: unless-stopped
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus/prometheus.yaml:/etc/prometheus/prometheus.yaml
networks:
{{ $.NetworkName }}:
{{ if $.Network }}ipv4_address: 10.186.73.202{{ end }}
Expand Down
10 changes: 5 additions & 5 deletions e2e/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (p *Provider) Setup() error {
return errors.Wrap(err, "generate compose file")
}

err = os.WriteFile(filepath.Join(p.Testnet.Dir, "docker-compose.yml"), bz, 0o644)
err = os.WriteFile(filepath.Join(p.Testnet.Dir, "docker-compose.yaml"), bz, 0o644)
if err != nil {
return errors.Wrap(err, "write compose file")
}
Expand Down Expand Up @@ -316,7 +316,7 @@ func additionalServices(testnet types.Testnet) []string {
// ExecCompose runs a Docker Compose command for a testnet.
func ExecCompose(ctx context.Context, dir string, args ...string) error {
err := exec.Command(ctx, append(
[]string{"docker", "compose", "-f", filepath.Join(dir, "docker-compose.yml")},
[]string{"docker", "compose", "-f", filepath.Join(dir, "docker-compose.yaml")},
args...)...)
if err != nil {
return errors.Wrap(err, "exec docker-compose")
Expand All @@ -328,7 +328,7 @@ func ExecCompose(ctx context.Context, dir string, args ...string) error {
// ExecComposeVerbose runs a Docker Compose command for a testnet and displays its output.
func ExecComposeVerbose(ctx context.Context, dir string, args ...string) error {
err := exec.CommandVerbose(ctx, append(
[]string{"docker", "compose", "-f", filepath.Join(dir, "docker-compose.yml")},
[]string{"docker", "compose", "-f", filepath.Join(dir, "docker-compose.yaml")},
args...)...)
if err != nil {
return errors.Wrap(err, "exec docker-compose verbose")
Expand Down Expand Up @@ -358,7 +358,7 @@ func Exec(ctx context.Context, args ...string) error {
// image: omniops/halo:main # Upgrade node0:omniops/halo:v1.0
// restart: unless-stopped
func ReplaceUpgradeImage(dir, service string) error {
before, err := os.ReadFile(filepath.Join(dir, "docker-compose.yml"))
before, err := os.ReadFile(filepath.Join(dir, "docker-compose.yaml"))
if err != nil {
return errors.Wrap(err, "read compose file")
}
Expand All @@ -370,7 +370,7 @@ func ReplaceUpgradeImage(dir, service string) error {
return errors.New("no upgrade image found")
}

err = os.WriteFile(filepath.Join(dir, "docker-compose.yml"), after, 0o644)
err = os.WriteFile(filepath.Join(dir, "docker-compose.yaml"), after, 0o644)
if err != nil {
return errors.Wrap(err, "write compose file")
}
Expand Down
4 changes: 2 additions & 2 deletions e2e/docker/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func TestComposeTemplate(t *testing.T) {

require.NoError(t, p.Setup())

bz, err := os.ReadFile(filepath.Join(dir, "docker-compose.yml"))
bz, err := os.ReadFile(filepath.Join(dir, "docker-compose.yaml"))
require.NoError(t, err)

tutil.RequireGoldenBytes(t, bz)
Expand All @@ -137,7 +137,7 @@ func TestComposeTemplate(t *testing.T) {
}
require.NoError(t, err)

bz, err := os.ReadFile(filepath.Join(dir, "docker-compose.yml"))
bz, err := os.ReadFile(filepath.Join(dir, "docker-compose.yaml"))
require.NoError(t, err)

tutil.RequireGoldenBytes(t, bz)
Expand Down
4 changes: 2 additions & 2 deletions e2e/docker/testdata/TestComposeTemplate_commit.golden
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ services:
container_name: prometheus
image: prom/prometheus:latest
command:
- --config.file=/etc/prometheus/prometheus.yml
- --config.file=/etc/prometheus/prometheus.yaml
- --web.console.libraries=/usr/share/prometheus/console_libraries
- --web.console.templates=/usr/share/prometheus/consoles
- --enable-feature=exemplar-storage
- --enable-feature=agent
restart: unless-stopped
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus/prometheus.yaml:/etc/prometheus/prometheus.yaml
networks:
test:
ipv4_address: 10.186.73.202
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ services:
container_name: prometheus
image: prom/prometheus:latest
command:
- --config.file=/etc/prometheus/prometheus.yml
- --config.file=/etc/prometheus/prometheus.yaml
- --web.console.libraries=/usr/share/prometheus/console_libraries
- --web.console.templates=/usr/share/prometheus/consoles
- --enable-feature=exemplar-storage
- --enable-feature=agent
restart: unless-stopped
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus/prometheus.yaml:/etc/prometheus/prometheus.yaml
networks:
test:
ipv4_address: 10.186.73.202
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ services:
container_name: prometheus
image: prom/prometheus:latest
command:
- --config.file=/etc/prometheus/prometheus.yml
- --config.file=/etc/prometheus/prometheus.yaml
- --web.console.libraries=/usr/share/prometheus/console_libraries
- --web.console.templates=/usr/share/prometheus/consoles
- --enable-feature=exemplar-storage
- --enable-feature=agent
restart: unless-stopped
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus/prometheus.yaml:/etc/prometheus/prometheus.yaml
networks:
test:
ipv4_address: 10.186.73.202
Expand Down
12 changes: 6 additions & 6 deletions e2e/vmcompose/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ func (p *Provider) Setup() error {
continue // No need to generate prometheus config
}

// Update custom prometheus.yml config for this VM
promCfgFile := filepath.Join(p.Testnet.Dir, "prometheus", "prometheus.yml")
// Update custom prometheus.yaml config for this VM
promCfgFile := filepath.Join(p.Testnet.Dir, "prometheus", "prometheus.yaml")
agentCfg, err := os.ReadFile(promCfgFile)
if err != nil {
return errors.Wrap(err, "read prometheus config")
Expand Down Expand Up @@ -195,7 +195,7 @@ func (p *Provider) Upgrade(ctx context.Context, cfg types.ServiceConfig) error {
addFile("monitor", "monitor.toml")
addFile("monitor", "privatekey")

addFile("prometheus", "prometheus.yml") // Prometheus isn't a "service", so not actually copied
addFile("prometheus", "prometheus.yaml") // Prometheus isn't a "service", so not actually copied

// Do initial sequential ssh to each VM, ensure we can connect.
for vmName, instance := range p.Data.VMs {
Expand Down Expand Up @@ -242,7 +242,7 @@ func (p *Provider) Upgrade(ctx context.Context, cfg types.ServiceConfig) error {
}
}

log.Debug(ctx, "Copying docker-compose.yml", "vm", vmName)
log.Debug(ctx, "Copying docker-compose.yaml", "vm", vmName)
composeFile := vmComposeFile(instance.IPAddress.String())
localComposePath := filepath.Join(p.Testnet.Dir, composeFile)
remoteComposePath := filepath.Join("/omni", p.Testnet.Name, composeFile)
Expand Down Expand Up @@ -342,7 +342,7 @@ func (p *Provider) StartNodes(ctx context.Context, _ ...*e2e.Node) error {
startCmd := fmt.Sprintf("cd /omni/%s && "+
"sudo mv %s docker-compose.yaml && "+
"sudo mv %s evm-init.sh && "+
"sudo mv %s prometheus/prometheus.yml && "+
"sudo mv %s prometheus/prometheus.yaml && "+
"sudo docker compose pull &&"+
"sudo ./evm-init.sh && "+
"sudo docker compose up -d &&"+
Expand Down Expand Up @@ -463,7 +463,7 @@ func copyFileToGCP(ctx context.Context, localPath string, remotePath string, ide
}

func vmAgentFile(internalIP string) string {
return "prometheus/" + strings.ReplaceAll(internalIP, ".", "-") + "-prometheus.yml"
return "prometheus/" + strings.ReplaceAll(internalIP, ".", "-") + "-prometheus.yaml"
}

func vmComposeFile(internalIP string) string {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/install_foundry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi

# This tells https://foundry.paradigm.xyz where to install foundryup -
# $FOUNDRY_DIR/bin. This dir is added to $GITHUB_PATH in
# .github/workflows/pre-commit.yml
# .github/workflows/pre-commit.yaml
export FOUNDRY_DIR="$HOME/.foundry";


Expand Down
2 changes: 1 addition & 1 deletion scripts/verifypr/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# verifypr

Simple script that is called by [verifypr](../../.github/workflows/ci-verifypr.yml) github action
Simple script that is called by [verifypr](../../.github/workflows/ci-verifypr.yaml) github action
that verifies omni PRs against the conventional commit template.

See supported types [here](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum)

0 comments on commit ac1f411

Please sign in to comment.