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

Migrate out of dockerhub #661

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bddb1df
flags and changes
vishalmaurya-oracle Dec 13, 2022
8bb67fe
support for architectures types in application create and deploy
ssunny3141 Jan 9, 2023
b2d7876
cleaned up comments and debug prints
ssunny3141 Jan 10, 2023
fda074c
cleaned up comments and debug prints
ssunny3141 Jan 10, 2023
624da1f
adding nil for missing arch parameter
ssunny3141 Jan 11, 2023
2a2711f
fixing wrong yaml parser
ssunny3141 Jan 11, 2023
47ad82c
fixing --local flag for deploy
ssunny3141 Jan 11, 2023
b657fa8
testing with local fnserver image
ssunny3141 Jan 14, 2023
97c3f94
fixing bug introduced by reading response body before processing
ssunny3141 Jan 14, 2023
b85f689
updating oci sdk for arch param inclusion
ssunny3141 Jan 18, 2023
18c2200
updating oci sdk for arch param inclusion
ssunny3141 Jan 18, 2023
5458387
updated pr
ssunny3141 Jan 20, 2023
231f85e
removing debugs
ssunny3141 Jan 24, 2023
9833f00
removing debugs
ssunny3141 Jan 24, 2023
4580960
adding arm64 lib build
ssunny3141 Feb 1, 2023
86b8f12
adding artifact step
ssunny3141 Feb 1, 2023
d1dee5f
removing application update flow
ssunny3141 Feb 16, 2023
200ec98
replacing architectures with shape enum
ssunny3141 Mar 4, 2023
56aac56
shape type support and shape in function inspect
ssunny3141 Mar 20, 2023
6624123
updating prev sdk
ssunny3141 Mar 20, 2023
3850235
updating to fix compile errors
ssunny3141 Mar 20, 2023
7d66cea
merging from master
ssunny3141 Mar 20, 2023
9b2f3c9
removing debug
ssunny3141 Mar 20, 2023
26846b7
updating build tag
ssunny3141 Mar 24, 2023
935fb1c
updating vendor
ssunny3141 Mar 24, 2023
67be165
removing arm64 test builds
ssunny3141 Mar 26, 2023
1320e61
updating go version for builds
ssunny3141 Mar 26, 2023
e40b9b3
removing debugs
ssunny3141 Mar 26, 2023
05c4464
updating go version in dockerfile
ssunny3141 Mar 26, 2023
12273ef
addressing review comments
ssunny3141 Mar 27, 2023
7575d2d
removing a region from deploy as it is not supported by ocisdk
ssunny3141 Mar 28, 2023
75e766d
add container namespace
Bhashkarjya Apr 5, 2023
53f6c5d
change the container registry namespace to docker.io
Bhashkarjya Apr 5, 2023
eb20499
resolve failing cli_runtime_fallback unit test
Bhashkarjya Apr 5, 2023
0e387f0
resolve failing cli_runtime_fallback unit test
Bhashkarjya Apr 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 10 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- GO111MODULE=on
- GOFLAGS=-mod=vendor
- GOPATH=/home/circleci/go
- GOVERSION=1.16.3
- GOVERSION=1.17
- OS=linux
- ARCH=amd64
steps:
Expand All @@ -30,6 +30,15 @@ jobs:
sudo service docker stop
curl -fsSL https://get.docker.com/ | sudo sh
- run: docker version
- run:
name: test build linux arm64
command: go build -o fn_linux_arm64
environment:
GOOS: linux
GOARCH: arm64
- store_artifacts:
path: fn_linux_arm64
destination: fn_linux_arm64
- run:
name: build and test
command: make test
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#

# build stage
FROM golang:1.16.3-alpine3.12 AS build-env
FROM golang:1.17.0-alpine3.14 AS build-env
RUN apk add --no-cache gcc musl-dev
ARG D=/go/src/github.com/fnproject/cli
ARG GO111MODULE=on
Expand All @@ -24,7 +24,7 @@ ADD . $D
RUN cd $D && go build -o fn-alpine && cp fn-alpine /tmp/

# final stage
FROM alpine:3.12
FROM alpine:3.14
RUN apk add --no-cache ca-certificates curl
WORKDIR /app
COPY --from=build-env /tmp/fn-alpine /app/fn
Expand Down
4 changes: 2 additions & 2 deletions THIRD_PARTY_LICENSES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ The following dependencies of fn-cli are licensed under Apache 2.0 license

github.com/coreos/go-semver/semver
github.com/golang/mock/gomock
github.com/oracle/oci-go-sdk/v48
github.com/oracle/oci-go-sdk/v65
github.com/go-openapi/validate
github.com/xeipuuv/gojsonpointer
github.com/go-openapi/loads
Expand Down Expand Up @@ -1880,7 +1880,7 @@ Google Inc.
-----------------------------------------------------------------
The following dependency of fn-cli is licensed under Apache License 2.0

github.com/oracle/oci-go-sdk/v48
github.com/oracle/oci-go-sdk/v65

Apache License 2.0 : A copy of the Apache License V2.0 is included in this file.

Expand Down
9 changes: 5 additions & 4 deletions commands/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ package commands

import (
"fmt"
"os"
"path/filepath"

"github.com/fnproject/cli/common"
"github.com/urfave/cli"
"os"
"path/filepath"
)

// BuildCommand returns build cli.command
Expand Down Expand Up @@ -97,7 +96,9 @@ func (b *buildcmd) build(c *cli.Context) error {
}

buildArgs := c.StringSlice("build-arg")
ff, err = common.BuildFuncV20180708(common.IsVerbose(), fpath, ff, buildArgs, b.noCache)

// Passing empty shape for build command
ff, err = common.BuildFuncV20180708(common.IsVerbose(), fpath, ff, buildArgs, b.noCache, "")
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion commands/build_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (b *BuildServerCmd) buildServer(c *cli.Context) error {
if err != nil {
return err
}
err = common.RunBuild(common.IsVerbose(), dir, c.String("tag"), "Dockerfile", nil, b.noCache, containerEngineType)
err = common.RunBuild(common.IsVerbose(), dir, c.String("tag"), "Dockerfile", nil, b.noCache, containerEngineType, "")
if err != nil {
return err
}
Expand Down
31 changes: 20 additions & 11 deletions commands/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ import (
trigger "github.com/fnproject/cli/objects/trigger"
v2Client "github.com/fnproject/fn_go/clientv2"
models "github.com/fnproject/fn_go/modelsv2"
"github.com/oracle/oci-go-sdk/v48/artifacts"
ociCommon "github.com/oracle/oci-go-sdk/v48/common"
"github.com/oracle/oci-go-sdk/v48/keymanagement"
"github.com/oracle/oci-go-sdk/v65/artifacts"
ociCommon "github.com/oracle/oci-go-sdk/v65/common"
"github.com/oracle/oci-go-sdk/v65/keymanagement"
"github.com/urfave/cli"
)

Expand All @@ -58,7 +58,6 @@ type Message struct {
}

var RegionsWithOldKMSEndpoints = map[ociCommon.Region]struct{}{
ociCommon.RegionSEA: {},
ociCommon.RegionPHX: {},
ociCommon.RegionIAD: {},
ociCommon.RegionFRA: {},
Expand Down Expand Up @@ -184,6 +183,7 @@ func (p *deploycmd) flags() []cli.Flag {
// on the file system (can be overridden using the `path` arg in each `func.yaml`. The index/root function
// is the one that lives in the same directory as the app.yaml.
func (p *deploycmd) deploy(c *cli.Context) error {

appName := ""
dir := common.GetDir(c)

Expand Down Expand Up @@ -384,21 +384,30 @@ func (p *deploycmd) deployFuncV20180708(c *cli.Context, app *models.App, funcfil
}

buildArgs := c.StringSlice("build-arg")
_, err := common.BuildFuncV20180708(common.IsVerbose(), funcfilePath, funcfile, buildArgs, p.noCache)
if err != nil {
return err
}

// In case of local ignore the architectures parameter
shape := ""
if !p.local {
if err := common.PushV20180708(funcfile); err != nil {
return err
// fetch the architectures
shape = app.Shape
if shape == "" {
shape = common.DefaultAppShape
app.Shape = shape
}

if _, ok := common.ShapeMap[shape]; !ok {
return errors.New(fmt.Sprintf("Invalid application : %s shape: %s", app.Name, shape))
}
}

if err := p.signImage(funcfile); err != nil {
_, err := common.BuildFuncV20180708(common.IsVerbose(), funcfilePath, funcfile, buildArgs, p.noCache, shape)
if err != nil {
return err
}

if err := p.signImage(funcfile); err != nil {
return err
}
return p.updateFunction(c, app.ID, funcfile)
}

Expand Down
2 changes: 1 addition & 1 deletion commands/image_signature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/fnproject/cli/common"
"github.com/fnproject/cli/config"
"github.com/fnproject/fn_go/provider/oracle"
ociCommon "github.com/oracle/oci-go-sdk/v48/common"
ociCommon "github.com/oracle/oci-go-sdk/v65/common"
"github.com/spf13/viper"
"net/url"
"testing"
Expand Down
4 changes: 4 additions & 0 deletions commands/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ func (a *initFnCmd) BuildFuncFileV20180708(c *cli.Context, path string) error {
if err != nil {
return err
}
buildImage = common.ContainerRegistryNamespace + buildImage
// buildImage = common.AddContainerNamespace(buildImage)
a.ff.Build_image = buildImage
}
if helper.IsMultiStage() {
Expand All @@ -431,6 +433,8 @@ func (a *initFnCmd) BuildFuncFileV20180708(c *cli.Context, path string) error {
if err != nil {
return err
}
runImage = common.ContainerRegistryNamespace + runImage
// runImage = common.AddContainerNamespace(runImage)
a.ff.Run_image = runImage
}
}
Expand Down
2 changes: 1 addition & 1 deletion commands/invoke_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// +build windows
//go:build windows

package commands

Expand Down
1 change: 0 additions & 1 deletion commands/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func start(c *cli.Context) error {
}

image := fmt.Sprintf("%s:%s", common.FunctionsDockerImage, c.String("version"))

args = append(args, image)
cmd := exec.Command("docker", args...)
cmd.Stdout = os.Stdout
Expand Down
Loading