Git Product home page Git Product logo

go-repo-template's Introduction

Build Status Go Report Card Code Coverage Docker Repository on Quay

Table of Contents generated with DocToc

Top level title

xxx...

What is the XXX

xxx...

Community, discussion, contribution, and support

Check the CONTRIBUTING Doc for how to contribute to the repo.

You can reach the maintainers of this project at:


Getting Started

Prerequisites

Check the Development Doc for how to contribute to the repo.

XXXXX

xxx...

Trouble shooting

Please refer to Trouble shooting documentation for further info.

XXX References

If you have any further question about xxx, please refer to XXX help documentation for further information.

go-repo-template's People

Contributors

gyliu513 avatar kuanf avatar stevemar avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-repo-template's Issues

Leverage BUILD_LOCALLY to avoid local make error

  • codecov
  • image upload

When we build locally, I think we don't want to upload the coverage.cov and so an extra test is needed at https://github.com/IBM/go-repo-template/blob/master/common/scripts/codecov.sh

BUILD_LOCALLY=${1:?0}
shift

...

# Upload to codecov.io in post submit only for visualization
if [ "$BUILD_LOCALLY" == 0 ]; then
  bash <(curl -s https://codecov.io/bash) -t "${CODECOV_TOKEN}" -f "${REPORT_PATH}/coverage.cov"
fi

and in the makefile:

############################################################
# coverage section
############################################################

coverage:
	@common/scripts/codecov.sh ${BUILD_LOCALLY}

replace manifest-tool with docker manifest

Currently we 're using manifest-tool to build the multiarch image.

However, docker client has start to support build-in manifest to create and push the multiarch manifest, the PR: docker/cli#138 for that change bas been merged.

We need to replace the manifest-tool with docker manifest... to build the multiarch image.

However, the docker manifest... is experimental feature for now, we need to edit the config.json and set experimental to enabled.

/kind enhancement
/area config
/assign
/cc @gyliu513

Check failed in README.md on the table of contents

make check
./README.md:13: MD007 Unordered list indentation
./README.md:16: MD007 Unordered list indentation
./README.md:21: MD007 Unordered list indentation

This is automatically generated.

- [multicloud-operators-subscription-release](#multicloud-operators-subscription-release)
  - [What is the multicloud-operators-subscription-release](#what-is-the-multicloud-operators-subscription-release)
  - [Community, discussion, contribution, and support](#community-discussion-contribution-and-support)
  - [Getting Started](#getting-started)
    - [Prerequisites](#prerequisites)
    - [Deployment](#deployment)
    - [Trouble shooting](#trouble-shooting)

How we can fix it?

Create a make target to install all tools

The template required to install a number of tools (hadolint, shellcheck, yamllint, helm, golangci-lint, autopep8, mdl, awesome_bot, sass-lint, tslint, prototool, goimports).

It seems that the version as its importance because it generates different results depending on the used version. The Prow use given version and the developers probably installed other versions as the configuration for these tools in the template is seens to be linked to a specific version. (ie: #24 , #26 ... )

So, it would be useful to have a make target in the Makefile.common.mk which install these tools with the required version. It will be up to the developers to install the recommended version using that target or to install the ones they wanted.

The target must install a tool only if not yet installed and have flag to overwrite all already installed tools with the required version.

enhance the multi-arch image build

Multi-arch image build prow job depends on image build on each platform, after the image for each platform pushed to docker registry before the multi-arch image build prow job can be started.

But looks like the prow doesn't provide dependency support for prow jobs, I have logged a feature request for this: kubernetes/test-infra#16798

Currently, we have to check image for each platform is ready or not by script in job content, see: https://github.com/IBM/go-repo-template/blob/master/common/scripts/multiarch_image.sh
After all images are ready, the multi-arch image build prow job can be run to finally make the multi-arch image manifest.

/kind enhancement

Add a condition to not push the image to quay.io if BUILD_LOCALLY

When we build locally the image we don't want to push it to quay.io and so the Makefile code should be something like:

build-push-images: $(CONFIG_DOCKER_TARGET)
        @docker build . -f Dockerfile -t $(REGISTRY)/$(IMG):$(VERSION)
	@docker tag $(REGISTRY)/$(IMG):$(VERSION) $(REGISTRY)/$(IMG):latest
ifeq ($(BUILD_LOCALLY),0)
	@docker push $(REGISTRY)/$(IMG):$(VERSION)
	@docker push $(REGISTRY)/$(IMG):latest
endif

to avoid to do a push if we run locally.

Update copyright

We should use copyright as follows in this repo:

/*
 * Copyright 2020 IBM Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * 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.
 */

Update build-tool image to support real multi-arch image build

Currently, we have two docker images to provide building env for prow jobs:

  1. quay.io/multicloudlab/build-tools
  2. quay.io/multicloudlab/multicloudlab-builder

The first image contains all kinds of linter(golangci-linter, helm, yamllinter, mdl, shellcheck...) and some common language runtime( nodejs, python, ruby, golang...). It's mainly used to provide env for:

  • make check
  • make build(without docker image)
  • make coverage....

The second image contains golang, gcloud-sdk(to get credentials from GKE cluster) and docker client and daemon. It's mainly used to provide env for:

  • make image(build go binary and docker image)

We need to pay attention to the command of prow job when trying to use the second image, because we need to start docker daemon before running the make target, so you can see, I have to manually add entrypoint before `make images':

      - command:
        - entrypoint
        - make
        - images
        image: quay.io/multicloudlab/multicloudlab-builder:v20191217-d33a10d

Since we're going to support real multi-arch build(building artifacts in each platform) to replace current qemu simulation on amd64 platform, we need to build the build-tool image for different platforms(amd64, ppc64le and s390x).

However, given that the original quay.io/multicloudlab/build-tools image contains lots of linter tools that haven't been migrated to ppc64le and s390x. Besides IMO, running the make check or make lint stage in single platform(amd64) should be sufficient.

So my plan is:

  • rename the quay.io/multicloudlab/build-tools image to quay.io/multicloudlab/check-tool
  • only support the quay.io/multicloudlab/check-tool image for amd64 and make sure make check or make lint only run on amd64 cluster.
  • rename the quay.io/multicloudlab/multicloudlab-builder image to quay.io/multicloudlab/build-tool
  • support all platforms(amd64, power and s390x) for the quay.io/multicloudlab/build-tool image and create multi-arch manifest for it.
  • reduce the size of the quay.io/multicloudlab/check-tool and quay.io/multicloudlab/build-tool images by removing the unused tools for now, we can add more tools if required.
  • create prow jobs to automatically build the quay.io/multicloudlab/check-tool and quay.io/multicloudlab/build-tool images once any file in https://github.com/IBM/test-infra/tree/master/prow/docker is changed.
  • create prow job to automatically update the quay.io/multicloudlab/check-tool and quay.io/multicloudlab/build-tool images for all prow jobs after new images are ready in quay.io

/kind epic
/assign
/cc @gyliu513

lint-markdown failed on prow but not locally.

When running locally by running make lint-markdown, I have no error and these url are not accessible locally.

make lint-markdown
> Checking links in ./docs/development.md
> Will allow duplicate links
> Will allow redirects
> Will allow SSL errors
> Will allow network timeouts
> White list links matching: ./docs/deployment.md 
> Will not save results
Links to check: 1, 0 white listed
  1. https://github.com/thlorenz/doctoc 
Checking URLs: ✓
No issues :-)
> Checking links in ./README.md
> Will allow duplicate links
> Will allow redirects
> Will allow SSL errors
> Will allow network timeouts
> White list links matching: ./docs/deployment.md 
> Will not save results
Links to check: 9, 0 white listed
  1. http://35.227.205.240/?job=build_multicloud-operators-subscription-release_postsubmit 
  2. http://35.227.205.240/badge.svg?jobs=build_multicloud-operators-subscription-release_postsubmit 
  3. https://godoc.org/github.com/IBM/multicloud-operators-subscription-release 
  4. https://godoc.org/github.com/IBM/multicloud-operators-subscription-release?status.svg 
  5. https://goreportcard.com/report/github.com/IBM/multicloud-operators-subscription-release 
  6. https://goreportcard.com/badge/github.com/IBM/multicloud-operators-subscription-release 
  7. https://codecov.io/github/IBM/multicloud-operators-subscription-release?branch=master 
  8. https://codecov.io/gh/IBM/multicloud-operators-subscription-release/branch/master/graphs/badge.svg?branch=master 
  9. https://github.com/thlorenz/doctoc 
Checking URLs: ✓✓✓✓✓✓✓✓✓
No issues :-)
> Checking links in ./RELEASE.md
> Will allow duplicate links
> Will allow redirects
> Will allow SSL errors
> Will allow network timeouts
> White list links matching: ./docs/deployment.md 
> Will not save results
Links to check: 1, 0 white listed
  1. https://github.com/thlorenz/doctoc 
Checking URLs: ✓
No issues :-)
> Checking links in ./CONTRIBUTING.md
> Will allow duplicate links
> Will allow redirects
> Will allow SSL errors
> Will allow network timeouts
> White list links matching: ./docs/deployment.md 
> Will not save results
Links to check: 2, 0 white listed
  1. https://github.com/thlorenz/doctoc 
  2. https://github.com/ibm 
Checking URLs: ✓✓
No issues :-)

Summary
./docs/development.md: ✓
          ./README.md: ✓
         ./RELEASE.md: ✓
    ./CONTRIBUTING.md: ✓

but when running on prow, I have errors: http://35.227.205.240/log?job=check_multicloud-operators-subscription-release&id=1186726070892630018

Why locally the whitelist contains deployment.md and in prow development.md

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.