Skip to content

Commit

Permalink
More changes and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
costinm committed May 21, 2021
1 parent 0483432 commit 2cd0414
Show file tree
Hide file tree
Showing 83 changed files with 2,402 additions and 983 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up Go 1.14
- name: Set up Go 1.16
uses: actions/setup-go@v1
with:
go-version: 1.14
go-version: 1.16
id: go

- name: Check out code into the Go module directory
Expand All @@ -39,7 +39,7 @@ jobs:
- name: Build
run: |
go build -o ugate -v ./cmd/ugate
cd cmd/ugate && go build -o ../../ugate -v .
- name: Upload ugate
uses: actions/upload-artifact@v2
Expand Down
4 changes: 4 additions & 0 deletions .ko.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#defaultBaseImage: docker.io/library/ubuntu:bionic

defaultBaseImage: gcr.io/dmeshgate/ugate-dev:latest

2 changes: 1 addition & 1 deletion .run/go-ugate.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<kind value="DIRECTORY" />
<package value="github.com/costinm/ugate/cmd/ugate" />
<directory value="$PROJECT_DIR$/../ugate/cmd/ugate/" />
<filePath value="$PROJECT_DIR$/../ugate/cmd/ugate/ugate.go" />
<filePath value="$PROJECT_DIR$/cmd/ugate/ugate.go" />
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="update" run_configuration_type="MAKEFILE_TARGET_RUN_CONFIGURATION" />
</method>
Expand Down
8 changes: 8 additions & 0 deletions .run/push_ko.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="push/ko" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile" singleton="false">
<makefile filename="$PROJECT_DIR$/../ugate/Makefile" target="push/ko" workingDirectory="" arguments="">
<envs />
</makefile>
<method v="2" />
</configuration>
</component>
16 changes: 16 additions & 0 deletions .run/ugate-alice.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ugate-alice" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="dmesh" />
<working_directory value="$PROJECT_DIR$/../ugate/cmd/ugate/testdata/alice" />
<go_parameters value="-tags gvisor" />
<envs>
<env name="xGODEBUG" value="http2debug=2" />
<env name="GVISOR" value="dmesh0" />
</envs>
<kind value="DIRECTORY" />
<package value="github.com/costinm/ugate/cmd/ugate" />
<directory value="$PROJECT_DIR$/../ugate/cmd/ugatex/" />
<filePath value="$PROJECT_DIR$/../ugate/cmd/ugate/ugate.go" />
<method v="2" />
</configuration>
</component>
16 changes: 16 additions & 0 deletions .run/ugate-bob.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ugate-bob" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="dmesh" />
<working_directory value="$PROJECT_DIR$/../ugate/cmd/ugate/testdata/bob" />
<go_parameters value="-tags lwip" />
<envs>
<env name="xGODEBUG" value="http2debug=2" />
<env name="LWIP" value="dmesh1" />
</envs>
<kind value="DIRECTORY" />
<package value="github.com/costinm/ugate/cmd/ugate" />
<directory value="$PROJECT_DIR$/../ugate/cmd/ugatex/" />
<filePath value="$PROJECT_DIR$/../ugate/cmd/ugate/ugate.go" />
<method v="2" />
</configuration>
</component>
14 changes: 14 additions & 0 deletions .run/ugate-carol.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ugate-carol" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="dmesh" />
<working_directory value="$PROJECT_DIR$/../ugate/cmd/ugate/testdata/carol" />
<envs>
<env name="xGODEBUG" value="http2debug=2" />
</envs>
<kind value="DIRECTORY" />
<package value="github.com/costinm/ugate/cmd/ugate" />
<directory value="$PROJECT_DIR$/../ugate/cmd/ugate/" />
<filePath value="$PROJECT_DIR$/../ugate/cmd/ugate/ugate.go" />
<method v="2" />
</configuration>
</component>
14 changes: 14 additions & 0 deletions .run/ugate-gate.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ugate-gate" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="dmesh" />
<working_directory value="$PROJECT_DIR$/../ugate/cmd/ugate/testdata/gate" />
<envs>
<env name="xGODEBUG" value="http2debug=2" />
</envs>
<kind value="DIRECTORY" />
<package value="github.com/costinm/ugate/cmd/ugate" />
<directory value="$PROJECT_DIR$/../ugate/cmd/ugate/" />
<filePath value="$PROJECT_DIR$/../ugate/cmd/ugate/ugate.go" />
<method v="2" />
</configuration>
</component>
14 changes: 14 additions & 0 deletions .run/ugate-s1.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ugate-s1" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="dmesh" />
<working_directory value="$PROJECT_DIR$/../ugate/cmd/ugate/testdata/s1" />
<envs>
<env name="XGODEBUG" value="http2debug=2" />
</envs>
<kind value="DIRECTORY" />
<package value="github.com/costinm/ugate/cmd/ugate" />
<directory value="$PROJECT_DIR$/../ugate/cmd/ugate/" />
<filePath value="$PROJECT_DIR$/../ugate/cmd/ugate/ugate.go" />
<method v="2" />
</configuration>
</component>
6 changes: 6 additions & 0 deletions .run/ugate.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ugate" type="CloudCodeCloudRunConfigurationType" factoryName="CloudCodeCloudDeployRunConfigurationFactory" show_console_on_std_err="false" show_console_on_std_out="false" gcpProject="{&quot;googleUsername&quot;:&quot;[email protected]&quot;,&quot;projectId&quot;:&quot;dmeshgate&quot;,&quot;projectName&quot;:&quot;dmeshgate&quot;,&quot;projectNumber&quot;:584624515903}" imageBuilder="{&quot;name&quot;:&quot;Docker&quot;,&quot;payload&quot;:{&quot;path&quot;:&quot;Dockerfile&quot;}}">
<option name="allowRunningInParallel" value="false" />
<option name="buildEnvironment" value="Local" />
<option name="buildpacksEnv">
<map />
</option>
Expand All @@ -17,6 +18,9 @@
<option name="environmentVariables">
<map />
</option>
<option name="gcbSettings">
<GoogleCloudBuildSettings />
</option>
<option name="gkeClusterLocation" />
<option name="gkeClusterName" />
<option name="gkeClusterNamespace" value="default" />
Expand All @@ -29,12 +33,14 @@
<option name="memoryAllocated" value="MIB_256" />
<option name="minInstances" value="" />
<option name="platform" value="FULLY_MANAGED" />
<option name="projectPathOnTarget" />
<option name="selectedOptions">
<list />
</option>
<option name="serviceAccount" value="" />
<option name="serviceName" value="ugate" />
<option name="timeout" value="900" />
<option name="vpcConnector" value="" />
<method v="2" />
</configuration>
</component>
6 changes: 2 additions & 4 deletions .run/ugate_Dockerfile.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
<configuration default="false" name="ugate/Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="costinm/ugate:latest" />
<option name="buildCliOptions" value="" />
<option name="command" value="" />
<option name="imageTag" value="gcr.io/dmeshgate/ugate:latest" />
<option name="buildOnly" value="true" />
<option name="containerName" value="ugate" />
<option name="entrypoint" value="" />
<option name="envVars">
<list>
<DockerEnvVarImpl>
Expand Down
30 changes: 15 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
#FROM golang:latest AS build
FROM golang:alpine AS build

#RUN apk add --no-cache git

RUN env

# Default is /go directory, which is set a GOPATH
# That doesn't work with go.mod
WORKDIR /ws

ENV GO111MODULE=on
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOPROXY=https://proxy.golang.org

COPY . .
COPY go.* ./
COPY cmd cmd
COPY dns dns
COPY webpush webpush
COPY pkg pkg
COPY ext ext
COPY *.go ./

# COPY . .

# Runs in /go directory
RUN go build -a -gcflags='all=-N -l' -ldflags '-extldflags "-static"' \
-o ugate ./cmd/ugate
RUN cd cmd/ugate && go build -a -gcflags='all=-N -l' -ldflags '-extldflags "-static"' \
-o ../../ugate ./

FROM alpine:latest

## Same base as Istio debug
#FROM ubuntu:bionic AS wps
# Or distroless
#FROM docker.io/istio/base:default AS wps
#RUN apt-get update && apt install less net-tools

COPY --from=build /ws/ugate /usr/local/bin/ugate
COPY --from=build /ws/cmd/ugate/iptables.sh /usr/local/bin/
COPY --from=build /ws/cmd/iptables.sh /usr/local/bin/
COPY --from=build /ws/cmd/ugate/run.sh /usr/local/bin/
#COPY --from=build /ws/dlv /usr/local/bin/dlv

RUN apk add iptables ip6tables make &&\
mkdir -p /var/lib/istio && \
Expand All @@ -49,11 +48,12 @@ RUN mkdir -p /etc/certs && \
chown -R 1337 /etc/certs /etc/istio /var/lib/istio

EXPOSE 15007
EXPOSE 8081
EXPOSE 8080
EXPOSE 15009
EXPOSE 15003

ENV PORT=8080
#ENV PORT=8080

# Defaults
#COPY ./var/lib/istio /var/lib/istio/
Expand Down
Loading

0 comments on commit 2cd0414

Please sign in to comment.