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

Merging the latest updates from develop #5

Merged
merged 88 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
f10477e
Creation of script to check upcoming maintenance on nodes
cdunbar13 Nov 14, 2023
6c754e1
script now can detect and temporarily disable the screen_reader for b…
cdunbar13 Nov 14, 2023
1db325a
Bucket changed to unique name
max-nag Nov 17, 2023
d352619
PR review updates
cdunbar13 Nov 15, 2023
ee503c6
Merge pull request #1977 from cdunbar13/maintenance-api-script
cdunbar13 Nov 20, 2023
d2c79f0
Add Zonal with lower capacity band support for filestore instance
harshthakkar01 Nov 20, 2023
3f4c57e
Fix: variable takes structured data when set
nick-stroud Nov 21, 2023
f5b1861
Merge pull request #1984 from nick-stroud/slurm-plugin-type
nick-stroud Nov 21, 2023
46a6495
Add documentation how to use max_hops plugin
nick-stroud Nov 21, 2023
9ed2e14
Merge pull request #1983 from nick-stroud/slurm-max-distance
nick-stroud Nov 21, 2023
8e3de7f
Initial testing scripts with new folder for unittests
cdunbar13 Nov 20, 2023
acc12f5
Merge pull request #1982 from harshthakkar01/zonal_filestore
harshthakkar01 Nov 21, 2023
b52fc61
Reduce usage of `log.Fatal` in tests, use `c.Fatal` instead
mr0re1 Nov 21, 2023
6ada8bc
Merge pull request #1985 from mr0re1/test_fatal
mr0re1 Nov 21, 2023
f48acd3
Implement Custom Logger
alyssa-sm Nov 17, 2023
5927c2d
Merge pull request #1979 from alyssa-sm/improve-ghpc-deploy-output
alyssa-sm Nov 22, 2023
a08e70d
Refactor pkg/config tests
mr0re1 Nov 22, 2023
254f196
Merge pull request #1987 from mr0re1/test_config
mr0re1 Nov 22, 2023
33670e7
Remove usage of `log.Fatal` from non-tests files
mr0re1 Nov 22, 2023
b398d9f
Refactor `pkg/modulewriter` tests
mr0re1 Nov 22, 2023
764fb5a
Merge pull request #1990 from mr0re1/test_modulewrt
mr0re1 Nov 22, 2023
af10092
Merge pull request #1989 from mr0re1/log_fix
mr0re1 Nov 22, 2023
8050588
Replace `Equals`-checker with more appropriate
mr0re1 Nov 22, 2023
871bc72
Change to use google cloud module instead of uuid
max-nag Nov 24, 2023
dc92459
Front end go version updated
max-nag Nov 24, 2023
89595d0
Refactor `pkg/deploymentio` tests
mr0re1 Nov 22, 2023
02cddde
PR Review update
cdunbar13 Nov 22, 2023
580158f
Merge pull request #1978 from max-nag/front-end-unique-bucket-name
tpdownes Nov 27, 2023
f6ab667
Merge pull request #1981 from cdunbar13/maintenance-api-testing
cdunbar13 Nov 27, 2023
05d32b4
Merge pull request #1988 from mr0re1/test_depl
mr0re1 Nov 27, 2023
1d665eb
Merge pull request #1992 from max-nag/front-end-go-version-fix
cboneti Nov 27, 2023
f722b5d
Add `addlicense` pre-commit hook
mr0re1 Nov 27, 2023
8966d2b
Merge pull request #1994 from mr0re1/addl
mr0re1 Nov 27, 2023
e56eee9
Add test to ensure that all modules have metada.yaml set
mr0re1 Nov 28, 2023
4d9a39a
Add codespell: workflow, (#1888)
yarikoptic Nov 28, 2023
cef1b65
Merge pull request #1991 from mr0re1/tst_haslen
mr0re1 Nov 28, 2023
88dcd24
Merge pull request #1996 from mr0re1/meta_test
mr0re1 Nov 28, 2023
89749f9
Add modules metadata. Part 1 of 4
mr0re1 Nov 28, 2023
f5d7fbd
Split `pkg/validators/validators.go` on multiple files.
mr0re1 Nov 28, 2023
7ebf6c0
Bump cryptography from 41.0.4 to 41.0.6 in /community/front-end/ofe
dependabot[bot] Nov 29, 2023
3cd333b
Merge pull request #2002 from mr0re1/ref_val
mr0re1 Nov 29, 2023
cb1c715
Merge pull request #1997 from mr0re1/meta_p1
mr0re1 Nov 29, 2023
31d0093
Add modules metadata. Part 2 of 4
mr0re1 Nov 28, 2023
d198216
Merge pull request #1998 from mr0re1/meta_p2
mr0re1 Nov 29, 2023
6069207
Add modules metadata. Part 3 of 4
mr0re1 Nov 28, 2023
184349a
Fix panic, refactor to meet gocyclo requirements
mr0re1 Nov 29, 2023
59f99fa
pre-commit. Remove `go-build` hook
mr0re1 Nov 30, 2023
b1e4692
Merge pull request #1999 from mr0re1/meta_p3
mr0re1 Nov 30, 2023
dbbb9d7
Add modules metadata. Part 4 of 4
mr0re1 Nov 28, 2023
1217af0
Fix qsim version in example to avoid new CMake changes
tpdownes Nov 30, 2023
bf10fdd
Merge pull request #2000 from mr0re1/meta_p4
mr0re1 Nov 30, 2023
8550236
Merge pull request #2008 from tpdownes/fix_qsim_version
tpdownes Nov 30, 2023
d64823a
Update slurm modules to point to fork
mr0re1 Nov 30, 2023
7a4f2fc
Merge pull request #2006 from mr0re1/nuclearwaronthedancefloor
mr0re1 Nov 30, 2023
eac8705
Merge pull request #2009 from mr0re1/to_fork
mr0re1 Dec 1, 2023
beea522
DRAFT
mr0re1 Nov 26, 2023
b04c70c
Merge pull request #1993 from mr0re1/tst_big
mr0re1 Dec 1, 2023
23a05d9
Merge pull request #1995 from mr0re1/pc_go_build
mr0re1 Dec 1, 2023
4cd67eb
Document how to use 'sudo -i' to manually install spack packages
nick-stroud Dec 2, 2023
1932aed
Bump golang.org/x/sys from 0.14.0 to 0.15.0
dependabot[bot] Dec 4, 2023
e91980b
Merge pull request #2022 from GoogleCloudPlatform/main
tpdownes Dec 4, 2023
78ff3cd
Merge pull request #2017 from GoogleCloudPlatform/dependabot/go_modul…
tpdownes Dec 4, 2023
f664888
Bump google.golang.org/api from 0.151.0 to 0.152.0
dependabot[bot] Dec 4, 2023
1a55d11
Merge pull request #2018 from GoogleCloudPlatform/dependabot/go_modul…
tpdownes Dec 4, 2023
768366b
Bump github.com/spf13/afero from 1.10.0 to 1.11.0
dependabot[bot] Dec 4, 2023
2e2deaa
Merge pull request #2019 from GoogleCloudPlatform/dependabot/go_modul…
tpdownes Dec 4, 2023
c4c1f7e
Bump github.com/go-git/go-git/v5 from 5.10.0 to 5.10.1
dependabot[bot] Dec 4, 2023
a5b1e9d
Merge pull request #2020 from GoogleCloudPlatform/dependabot/go_modul…
tpdownes Dec 4, 2023
ab73021
Merge pull request #2003 from GoogleCloudPlatform/dependabot/pip/comm…
tpdownes Dec 4, 2023
6b0ca94
Don't test metadata services against legacy ones.
mr0re1 Dec 4, 2023
aacfde3
Merge pull request #2024 from mr0re1/relax_services_test
mr0re1 Dec 5, 2023
8731b33
Adding snippet of commonly used images to make it easy to modify a bl…
nick-stroud Dec 1, 2023
ce56126
Document how to chain user spack install with system spack install
nick-stroud Dec 2, 2023
1942ef2
Merge pull request #2015 from nick-stroud/spack_user_access
nick-stroud Dec 5, 2023
03c727b
Merge pull request #2014 from nick-stroud/formatted-image-examples
nick-stroud Dec 5, 2023
cdb36d2
Fix terraform TFlint plugin to penultimate release
tpdownes Dec 5, 2023
1efe8e4
Remove local SSD warning for Slurm v5 compute nodes after known issue…
tpdownes Dec 5, 2023
1098e99
Updated to check for slurm nodes if option is given
cdunbar13 Nov 21, 2023
f331172
PR review updates
cdunbar13 Dec 5, 2023
f4f093f
Fix local SSD example enabling VM family compatible with placement po…
tpdownes Dec 5, 2023
70a56f9
Adopt latest local SSD formatting script
tpdownes Dec 5, 2023
f3a0c47
Merge pull request #2023 from cdunbar13/maintenance-api-slurm
cdunbar13 Dec 5, 2023
11b6ca3
Merge pull request #2026 from tpdownes/fix_local_ssd_example
tpdownes Dec 6, 2023
f084cd0
Merge pull request #2025 from tpdownes/eliminate_local_ssd_warning
tpdownes Dec 6, 2023
78a6bb0
Exclude `pkg/*` from `packer-readme` hook.
mr0re1 Dec 7, 2023
c9a16d6
Merge pull request #2028 from mr0re1/didnt_read
mr0re1 Dec 7, 2023
37240d7
Disable `go-critic` hook
mr0re1 Dec 8, 2023
580a232
Merge pull request #2029 from mr0re1/no_critic
mr0re1 Dec 8, 2023
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
7 changes: 7 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[codespell]
# js/ folder seems to contain vendored code
skip = .git,*.pdf,*.svg,*.min.js,*.js.map,js,requirements.txt
# docs/videos/healthcare-and-life-sciences/lysozyme-example/submit.sh has CONECT - might be "legit"
ignore-regex = HETATM -e CONECT|\([A-Z]\)[a-z]+
#
ignore-words-list = namd,tempdate,te,ue,startd,passtime
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ packer-manifest.json
#### Python Virtual Environments
venv*/

### Python cache files
**/__pycache__

#### Exclude from gitingore
!tools/validate_configs/golden_copies/expectations/*/*/*/defaults.auto.pkrvars.hcl
!tools/validate_configs/golden_copies/expectations/*/*/terraform.tfvars
25 changes: 19 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ repos:
entry: tools/autodoc/terraform_docs.sh
language: script
files: ^.*\.pkr\.hcl$
exclude: (pkg\/.*$)|(tools/validate_configs/golden_copies/.*)
pass_filenames: true
require_serial: true
- id: duplicate-diff
Expand All @@ -57,6 +58,14 @@ repos:
files: '.*\.tf$'
pass_filenames: false
require_serial: true
- id: addlicense
name: addlicense
language: system
entry: addlicense
args: ['-c', '"Google LLC"', '-l', 'apache']
exclude: docs/videos/healthcare-and-life-sciences/lysozyme-example/submit.sh
pass_filenames: true

- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
Expand All @@ -66,13 +75,12 @@ repos:
- id: go-cyclo
args: [-over=15]
- id: go-unit-tests
- id: go-build
- id: go-mod-tidy
- repo: https://github.com/tekwizely/pre-commit-golang
rev: v1.0.0-rc.1
hooks:
- id: go-critic
args: [-disable, "#experimental,sloppyTypeAssert"]
# Disabled temporarily due to https://github.com/go-critic/go-critic/issues/1388
# - repo: https://github.com/tekwizely/pre-commit-golang
# rev: v1.0.0-rc.1
# hooks:
# - id: go-critic
- repo: https://github.com/Bahjat/pre-commit-golang
rev: v1.0.2
hooks:
Expand Down Expand Up @@ -105,4 +113,9 @@ repos:
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
exclude: requirements.txt$|/js/
exclude: tools/validate_configs/golden_copies/.*
6 changes: 6 additions & 0 deletions .tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

plugin "google" {
enabled = true
version = "0.23.0"
source = "github.com/terraform-linters/tflint-ruleset-google"
}
plugin "terraform" {
enabled = true
version = "0.4.0"
source = "github.com/terraform-linters/tflint-ruleset-terraform"
}
rule "terraform_deprecated_index" {
enabled = true
}
Expand Down
11 changes: 1 addition & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MIN_PACKER_VERSION=1.7.9 # for building images
MIN_TERRAFORM_VERSION=1.2 # for deploying modules
MIN_GOLANG_VERSION=1.18 # for building ghpc

.PHONY: install install-user tests format add-google-license install-dev-deps \
.PHONY: install install-user tests format install-dev-deps \
warn-go-missing warn-terraform-missing warn-packer-missing \
warn-go-version warn-terraform-version warn-packer-version \
test-engine validate_configs validate_golden_copy packer-check \
Expand Down Expand Up @@ -65,15 +65,6 @@ install-dev-deps: warn-terraform-version warn-packer-version check-pre-commit ch
go install golang.org/x/tools/cmd/goimports@latest
go install honnef.co/go/tools/cmd/staticcheck@latest

ifeq (, $(shell which addlicense))
add-google-license:
$(error "could not find addlicense in PATH, run: go install github.com/google/addlicense@latest")
else
add-google-license:
# lysozyme-example is under CC-BY-4.0
addlicense -c "Google LLC" -l apache -ignore **/lysozyme-example/submit.sh .
endif

# RULES SUPPORTING THE ABOVE

test-engine: warn-go-missing
Expand Down
69 changes: 33 additions & 36 deletions cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"errors"
"fmt"
"hpc-toolkit/pkg/config"
"hpc-toolkit/pkg/logging"
"hpc-toolkit/pkg/modulewriter"
"hpc-toolkit/pkg/validators"
"log"
"path/filepath"
"strings"

Expand Down Expand Up @@ -83,46 +83,43 @@ func runCreateCmd(cmd *cobra.Command, args []string) {
deplDir := filepath.Join(outputDir, deplName)
checkErr(modulewriter.WriteDeployment(dc, deplDir, overwriteDeployment))

fmt.Println("To deploy your infrastructure please run:")
fmt.Println()
fmt.Printf(boldGreen("%s deploy %s\n"), execPath(), deplDir)
fmt.Println()
logging.Info("To deploy your infrastructure please run:")
logging.Info("")
logging.Info(boldGreen("%s deploy %s"), execPath(), deplDir)
logging.Info("")
printAdvancedInstructionsMessage(deplDir)
}

func printAdvancedInstructionsMessage(deplDir string) {
fmt.Println("Find instructions for cleanly destroying infrastructure and advanced manual")
fmt.Println("deployment instructions at:")
fmt.Println()
fmt.Printf("%s\n", modulewriter.InstructionsPath(deplDir))
logging.Info("Find instructions for cleanly destroying infrastructure and advanced manual")
logging.Info("deployment instructions at:")
logging.Info("")
logging.Info(modulewriter.InstructionsPath(deplDir))
}

func expandOrDie(path string) config.DeploymentConfig {
dc, ctx, err := config.NewDeploymentConfig(path)
if err != nil {
log.Fatal(renderError(err, ctx))
logging.Fatal(renderError(err, ctx))
}
// Set properties from CLI
if err := setCLIVariables(&dc.Config, cliVariables); err != nil {
log.Fatalf("Failed to set the variables at CLI: %v", err)
logging.Fatal("Failed to set the variables at CLI: %v", err)
}
if err := setBackendConfig(&dc.Config, cliBEConfigVars); err != nil {
log.Fatalf("Failed to set the backend config at CLI: %v", err)
}
if err := setValidationLevel(&dc.Config, validationLevel); err != nil {
log.Fatal(err)
}
if err := skipValidators(&dc); err != nil {
log.Fatal(err)
logging.Fatal("Failed to set the backend config at CLI: %v", err)
}
checkErr(setValidationLevel(&dc.Config, validationLevel))
checkErr(skipValidators(&dc))

if dc.Config.GhpcVersion != "" {
fmt.Printf("ghpc_version setting is ignored.")
logging.Info("ghpc_version setting is ignored.")
}
dc.Config.GhpcVersion = GitCommitInfo

// Expand the blueprint
if err := dc.ExpandConfig(); err != nil {
log.Fatal(renderError(err, ctx))
logging.Fatal(renderError(err, ctx))
}

validateMaybeDie(dc.Config, ctx)
Expand All @@ -134,29 +131,29 @@ func validateMaybeDie(bp config.Blueprint, ctx config.YamlCtx) {
if err == nil {
return
}
log.Println(renderError(err, ctx))

log.Println("One or more blueprint validators has failed. See messages above for suggested")
log.Println("actions. General troubleshooting guidance and instructions for configuring")
log.Println("validators are shown below.")
log.Println("")
log.Println("- https://goo.gle/hpc-toolkit-troubleshooting")
log.Println("- https://goo.gle/hpc-toolkit-validation")
log.Println("")
log.Println("Validators can be silenced or treated as warnings or errors:")
log.Println("")
log.Println("- https://goo.gle/hpc-toolkit-validation-levels")
log.Println("")
logging.Error(renderError(err, ctx))

logging.Error("One or more blueprint validators has failed. See messages above for suggested")
logging.Error("actions. General troubleshooting guidance and instructions for configuring")
logging.Error("validators are shown below.")
logging.Error("")
logging.Error("- https://goo.gle/hpc-toolkit-troubleshooting")
logging.Error("- https://goo.gle/hpc-toolkit-validation")
logging.Error("")
logging.Error("Validators can be silenced or treated as warnings or errors:")
logging.Error("")
logging.Error("- https://goo.gle/hpc-toolkit-validation-levels")
logging.Error("")

switch bp.ValidationLevel {
case config.ValidationWarning:
{
log.Println(boldYellow("Validation failures were treated as a warning, continuing to create blueprint."))
log.Println("")
logging.Error(boldYellow("Validation failures were treated as a warning, continuing to create blueprint."))
logging.Error("")
}
case config.ValidationError:
{
log.Fatal(boldRed("validation failed due to the issues listed above"))
logging.Fatal(boldRed("validation failed due to the issues listed above"))
}
}

Expand Down
10 changes: 5 additions & 5 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ package cmd
import (
"fmt"
"hpc-toolkit/pkg/config"
"hpc-toolkit/pkg/logging"
"hpc-toolkit/pkg/modulewriter"
"hpc-toolkit/pkg/shell"
"log"
"path/filepath"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -98,7 +98,7 @@ func runDeployCmd(cmd *cobra.Command, args []string) {
checkErr(fmt.Errorf("group %s is an unsupported kind %s", groupDir, group.Kind().String()))
}
}
fmt.Println("\n###############################")
logging.Info("\n###############################")
printAdvancedInstructionsMessage(deploymentRoot)
}

Expand Down Expand Up @@ -131,15 +131,15 @@ func deployPackerGroup(moduleDir string) error {
}
buildImage := applyBehavior == shell.AutomaticApply || shell.ApplyChangesChoice(c)
if buildImage {
log.Printf("initializing packer module at %s", moduleDir)
logging.Info("initializing packer module at %s", moduleDir)
if err := shell.ExecPackerCmd(moduleDir, false, "init", "."); err != nil {
return err
}
log.Printf("validating packer module at %s", moduleDir)
logging.Info("validating packer module at %s", moduleDir)
if err := shell.ExecPackerCmd(moduleDir, false, "validate", "."); err != nil {
return err
}
log.Printf("building image using packer module at %s", moduleDir)
logging.Info("building image using packer module at %s", moduleDir)
if err := shell.ExecPackerCmd(moduleDir, true, "build", "."); err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package cmd

import (
"fmt"
"hpc-toolkit/pkg/logging"

"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -50,5 +50,5 @@ var (
func runExpandCmd(cmd *cobra.Command, args []string) {
dc := expandOrDie(args[0])
checkErr(dc.ExportBlueprint(outputFilename))
fmt.Printf(boldGreen("Expanded Environment Definition created successfully, saved as %s.\n"), outputFilename)
logging.Info(boldGreen("Expanded Environment Definition created successfully, saved as %s."), outputFilename)
}
36 changes: 10 additions & 26 deletions cmd/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,24 @@ package cmd

import (
"os"
"path/filepath"

. "gopkg.in/check.v1"
)

func (s *MySuite) TestIsDir(c *C) {
dir, err := os.MkdirTemp("", "test-*")
if err != nil {
c.Fatal(err)
}
defer os.RemoveAll(dir)
dir := c.MkDir()
c.Assert(checkDir(nil, []string{dir}), IsNil)

err = checkDir(nil, []string{dir})
c.Assert(err, IsNil)
p := filepath.Join(dir, "does-not-exist")
c.Assert(checkDir(nil, []string{p}), NotNil)

os.RemoveAll(dir)
err = checkDir(nil, []string{dir})
c.Assert(err, NotNil)

f, err := os.CreateTemp("", "test-*")
if err != nil {
c.Fatal(err)
}
defer os.Remove(f.Name())
err = checkDir(nil, []string{f.Name()})
c.Assert(err, NotNil)
f, err := os.CreateTemp(dir, "test-*")
c.Assert(err, IsNil)
c.Assert(checkDir(nil, []string{f.Name()}), NotNil)
}

func (s *MySuite) TestRunExport(c *C) {
dir, err := os.MkdirTemp("", "test-*")
if err != nil {
c.Fatal(err)
}
defer os.RemoveAll(dir)

err = runExportCmd(nil, []string{dir})
c.Assert(err, NotNil)
dir := c.MkDir()
c.Assert(runExportCmd(nil, []string{dir}), NotNil)
}
15 changes: 6 additions & 9 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"errors"
"fmt"
"hpc-toolkit/pkg/config"
"log"
"hpc-toolkit/pkg/logging"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -49,7 +49,7 @@ var (
HPC deployments on the Google Cloud Platform.`,
Run: func(cmd *cobra.Command, args []string) {
if err := cmd.Help(); err != nil {
log.Fatalf("cmd.Help function failed: %s", err)
logging.Fatal("cmd.Help function failed: %s", err)
}
},
Version: "v1.26.0",
Expand All @@ -66,12 +66,9 @@ func init() {

// Execute the root command
func Execute() error {
// Don't prefix messages with data & time to improve readability.
// See https://pkg.go.dev/log#pkg-constants
log.SetFlags(0)
mismatch, branch, hash, dir := checkGitHashMismatch()
if mismatch {
fmt.Fprintf(os.Stderr, "WARNING: ghpc binary was built from a different commit (%s/%s) than the current git branch in %s (%s/%s). You can rebuild the binary by running 'make'\n",
logging.Error("WARNING: ghpc binary was built from a different commit (%s/%s) than the current git branch in %s (%s/%s). You can rebuild the binary by running 'make'",
GitBranch, GitCommitHash[0:7], dir, branch, hash[0:7])
}

Expand Down Expand Up @@ -198,7 +195,7 @@ func execPath() string {
// "simplification" of `ghpc` to `./ghpc`
return nice
}
// Code bellow assumes that `args0` contains path to file, not a
// Code below assumes that `args0` contains path to file, not a
// executable name from PATH.

{ // Find shortest & nicest form of args0
Expand Down Expand Up @@ -249,11 +246,11 @@ func execPath() string {
return args0
}

// checkErr is similar to cobra.CheckErr, but with renderError and log.Fatal
// checkErr is similar to cobra.CheckErr, but with renderError and logging.Fatal
// NOTE: this function uses empty YamlCtx, so if you have one, use renderError directly.
func checkErr(err error) {
if err != nil {
msg := fmt.Sprintf("%s: %s", boldRed("Error"), renderError(err, config.YamlCtx{}))
log.Fatal(msg)
logging.Fatal(msg)
}
}
Loading
Loading