Skip to content

Commit

Permalink
Fix Scheduler Output Paths
Browse files Browse the repository at this point in the history
Sanitize Imports
Fix server_tests
  • Loading branch information
SHARANTANGEDA committed Jan 23, 2021
1 parent abd51f5 commit 163eb09
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US
WORKDIR /notebooks
COPY notebooks/*.ipynb /notebooks/
WORKDIR /App
COPY . /App
WORKDIR /app
COPY . /app
WORKDIR /notebooks
CMD service openvswitch-switch start && jupyter notebook --ip 0.0.0.0 --allow-root
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ This version of mp-quic is not dependent on quic-go, and can be installed as a s

We currently support Go **_1.14+_**

Essential Environment Variables: `outputDir="ABSOLUTE_PATH_TO_OUTPUT_DIR` is needed for
scheduler implementation in native application

Choosing Schedulers:

// Available Schedulers: round_robin, low_latency
Expand Down
6 changes: 6 additions & 0 deletions constants/name.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package constants

const (
// Env Variable
OUTPUT_DIR = "outputDir"
)
2 changes: 1 addition & 1 deletion example/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os"
"sync"

quic "github.com/lucas-clemente/quic-go"
quic "github.com/SHARANTANGEDA/mp-quic"

"github.com/SHARANTANGEDA/mp-quic/h2quic"
"github.com/SHARANTANGEDA/mp-quic/internal/utils"
Expand Down
2 changes: 1 addition & 1 deletion example/client_benchmarker_cached/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"sync"
"time"

quic "github.com/lucas-clemente/quic-go"
quic "github.com/SHARANTANGEDA/mp-quic"

"github.com/SHARANTANGEDA/mp-quic/h2quic"
"github.com/SHARANTANGEDA/mp-quic/internal/utils"
Expand Down
2 changes: 1 addition & 1 deletion example/echo/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"log"
"math/big"

quic "github.com/lucas-clemente/quic-go"
quic "github.com/SHARANTANGEDA/mp-quic"
)

const addr = "localhost:4242"
Expand Down
2 changes: 1 addition & 1 deletion example/reqres/client/reqres.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"sync"
"time"

quic "github.com/SHARANTANGEDA/mp-quic"
"github.com/SHARANTANGEDA/mp-quic/internal/utils"
quic "github.com/lucas-clemente/quic-go"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion example/reqres/reqres.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"strings"
"time"

quic "github.com/SHARANTANGEDA/mp-quic"
"github.com/SHARANTANGEDA/mp-quic/internal/utils"
quic "github.com/lucas-clemente/quic-go"
)

var addr = "localhost:4242"
Expand Down
2 changes: 1 addition & 1 deletion h2quic/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"golang.org/x/net/http2"
"golang.org/x/net/http2/hpack"

quic "github.com/SHARANTANGEDA/mp-quic"
"github.com/SHARANTANGEDA/mp-quic/internal/protocol"
"github.com/SHARANTANGEDA/mp-quic/qerr"
quic "github.com/lucas-clemente/quic-go"

"time"

Expand Down
3 changes: 2 additions & 1 deletion h2quic/roundtrip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import (
"net/http"
"time"

quic "github.com/lucas-clemente/quic-go"
quic "github.com/SHARANTANGEDA/mp-quic"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
Expand Down
6 changes: 4 additions & 2 deletions h2quic/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"crypto/tls"
"errors"
"fmt"
"github.com/SHARANTANGEDA/mp-quic/constants"
"io"
"net"
"net/http"
Expand All @@ -17,10 +18,10 @@ import (
"golang.org/x/net/http2"
"golang.org/x/net/http2/hpack"

quic "github.com/SHARANTANGEDA/mp-quic"
"github.com/SHARANTANGEDA/mp-quic/internal/protocol"
"github.com/SHARANTANGEDA/mp-quic/internal/testdata"
"github.com/SHARANTANGEDA/mp-quic/qerr"
quic "github.com/lucas-clemente/quic-go"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -502,7 +503,8 @@ var _ = Describe("H2 server", func() {
return nil, testErr
}
fullpem, privkey := testdata.GetCertificatePaths()
err := ListenAndServeQUIC("", fullpem, privkey, nil)
err := ListenAndServeQUIC("", fullpem, privkey, nil, constants.SCHEDULER_ROUND_ROBIN,
"", false, 0.1, 10, false)
Expect(err).To(MatchError(testErr))
})
})
2 changes: 1 addition & 1 deletion integrationtests/gquic/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"strconv"
"time"

quic "github.com/SHARANTANGEDA/mp-quic"
"github.com/SHARANTANGEDA/mp-quic/h2quic"
"github.com/SHARANTANGEDA/mp-quic/integrationtests/tools/testserver"
"github.com/SHARANTANGEDA/mp-quic/internal/protocol"
quic "github.com/lucas-clemente/quic-go"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down
3 changes: 2 additions & 1 deletion integrationtests/self/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import (
"os"
"time"

quic "github.com/SHARANTANGEDA/mp-quic"
"github.com/SHARANTANGEDA/mp-quic/h2quic"
"github.com/SHARANTANGEDA/mp-quic/integrationtests/tools/testserver"
"github.com/SHARANTANGEDA/mp-quic/internal/protocol"
quic "github.com/lucas-clemente/quic-go"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
Expand Down
4 changes: 2 additions & 2 deletions integrationtests/self/handshake_rtt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import (
"net"
"time"

quic "github.com/SHARANTANGEDA/mp-quic"
"github.com/SHARANTANGEDA/mp-quic/integrationtests/tools/proxy"
"github.com/SHARANTANGEDA/mp-quic/internal/protocol"
"github.com/SHARANTANGEDA/mp-quic/internal/testdata"
"github.com/SHARANTANGEDA/mp-quic/internal/utils"
"github.com/SHARANTANGEDA/mp-quic/qerr"
quic "github.com/lucas-clemente/quic-go"

"github.com/SHARANTANGEDA/mp-quic/internal/testdata"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
Expand Down
2 changes: 1 addition & 1 deletion integrationtests/tools/testserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"net/http"
"strconv"

quic "github.com/SHARANTANGEDA/mp-quic"
"github.com/SHARANTANGEDA/mp-quic/h2quic"
"github.com/SHARANTANGEDA/mp-quic/internal/protocol"
"github.com/SHARANTANGEDA/mp-quic/internal/testdata"
quic "github.com/lucas-clemente/quic-go"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down
8 changes: 4 additions & 4 deletions mininettest/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import argparse
from basicTopo import setup_environment

SERVER_CMD = "/App/quic/server_mt"
CERTPATH = "--certpath /App/quic/quic_go_certs"
SERVER_CMD = "/app/quic/server_mt"
CERTPATH = "--certpath /app/quic/quic_go_certs"
SCH = "-scheduler %s"
ARGS = "-bind :6121 -www /var/www/"
END = "> /App/logs/server.logs 2>&1"
END = "> /app/logs/server.logs 2>&1"

BASIC_DELAY = 40

CLIENT_CMD = "/App/quic/client_mt -m https://10.0.0.20:6121/demo > /App/logs/client.logs 2>&1"
CLIENT_CMD = "/app/quic/client_mt -m https://10.0.0.20:6121/demo > /App/logs/client.logs 2>&1"

TCP_SERVER_CMD = "cd /var/www && python -m SimpleHTTPServer 80 &"
TCP_CLIENT_CMD = "curl -s -o /dev/null 10.0.0.20/demo &"
Expand Down
15 changes: 11 additions & 4 deletions scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,22 @@ type scheduler struct {
DumpExp bool
DumpPath string
dumpAgent experienceAgent

// Output Directory
outputDir string
}

func (sch *scheduler) setup() {
sch.outputDir = os.Getenv(constants.OUTPUT_DIR)
if sch.outputDir == "" {
panic("`outputDir` Env variable was not provided, this is needed for training")
}
sch.quotas = make(map[protocol.PathID]uint)
sch.retrans = make(map[protocol.PathID]uint64)
sch.waiting = 0

//Read lin to buffer
file, err := os.Open("/App/output/lin")
file, err := os.Open(sch.outputDir + "/lin")
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -1249,9 +1256,9 @@ func (sch *scheduler) performPacketSending(s *session, windowUpdateFrames []*wir
}
s.pathsLock.RUnlock()
//Write lin parameters
os.Remove("/App/output/lin")
os.Create("/App/output/lin")
file2, _ := os.OpenFile("/App/output/lin", os.O_WRONLY, 0600)
os.Remove(sch.outputDir + "/lin")
os.Create(sch.outputDir + "/lin")
file2, _ := os.OpenFile(sch.outputDir+"/lin", os.O_WRONLY, 0600)
for i := 0; i < banditDimension; i++ {
for j := 0; j < banditDimension; j++ {
fmt.Fprintf(file2, "%.8f\n", sch.MAaF[i][j])
Expand Down

0 comments on commit 163eb09

Please sign in to comment.