<commit_before>//
// Copyright (c) 2016 Intel 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.
//

package main

const userDataTemplate = `
{{- define "PROXIES" -}}
{{if len .HTTPSProxy }}https_proxy={{.HTTPSProxy}} {{end -}}
{{if len .HTTPProxy }}http_proxy={{.HTTPProxy}} {{end -}}
{{end}}
{{- define "CHECK" -}}
if [ $? -eq 0 ] ; then ret="OK" ; else ret="FAIL" ; fi ; curl -X PUT -d $ret 10.0.2.2:{{.HTTPServerPort -}}
{{end -}}
{{- define "OK" -}}
curl -X PUT -d "OK" 10.0.2.2:{{.HTTPServerPort -}}
{{end -}}
#cloud-config
mounts:
 - [hostgo, {{.GoPath}}, 9p, "trans=virtio,version=9p2000.L", 0, 0]
write_files:
{{- if len $.HTTPProxy }}
 - content: |
     Acquire::http::Proxy "{{$.HTTPProxy}}";
   path: /etc/apt/apt.conf
 - content: |
     [Service]
     Environment="HTTP_PROXY={{$.HTTPProxy}}"{{if len .HTTPSProxy}} "HTTPS_PROXY={{.HTTPSProxy}}{{end}}"{{if len .NoProxy}} "NO_PROXY={{.NoProxy}},singlevm{{end}}"
   path: /etc/systemd/system/docker.service.d/http-proxy.conf
{{- end}}
 - content: |
     #!/bin/sh
     printf "\n"
     printf "To run Single VM:\n"
     printf "\n"
     printf "cd {{.GoPath}}/src/github.com/01org/ciao/testutil/singlevm\n"
     printf "./setup.sh\n"
   path: /etc/update-motd.d/10-ciao-help-text
   permissions: '0755'
 - content: |
     deb https://apt.dockerproject.org/repo ubuntu-xenial main
   path: /etc/apt/sources.list.d/docker.list

runcmd:
 - echo "127.0.0.1 singlevm" >> /etc/hosts
 - rm /etc/update-motd.d/10-help-text /etc/update-motd.d/51-cloudguest<commit_msg>ciao-down: Fix an issue with GOPATH mounting<commit_after>//
// Copyright (c) 2016 Intel 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.
//

package main

const userDataTemplate = `
{{- define "PROXIES" -}}
{{if len .HTTPSProxy }}https_proxy={{.HTTPSProxy}} {{end -}}
{{if len .HTTPProxy }}http_proxy={{.HTTPProxy}} {{end -}}
{{end}}
{{- define "CHECK" -}}
if [ $? -eq 0 ] ; then ret="OK" ; else ret="FAIL" ; fi ; curl -X PUT -d $ret 10.0.2.2:{{.HTTPServerPort -}}
{{end -}}
{{- define "OK" -}}
curl -X PUT -d "OK" 10.0.2.2:{{.HTTPServerPort -}}
{{end -}}
#cloud-config
mounts:
 - [hostgo, {{.GoPath}}, 9p, "trans=virtio,version=9p2000.L", "0", "0"]
write_files:
{{- if len $.HTTPProxy }}
 - content: |
     Acquire::http::Proxy "{{$.HTTPProxy}}";
   path: /etc/apt/apt.conf
 - content: |
     [Service]
     Environment="HTTP_PROXY={{$.HTTPProxy}}"{{if len .HTTPSProxy}} "HTTPS_PROXY={{.HTTPSProxy}}{{end}}"{{if len .NoProxy}} "NO_PROXY={{.NoProxy}},singlevm{{end}}"
   path: /etc/systemd/system/docker.service.d/http-proxy.conf
{{- end}}
 - content: |
     #!/bin/sh
     printf "\n"
     printf "To run Single VM:\n"
     printf "\n"
     printf "cd {{.GoPath}}/src/github.com/01org/ciao/testutil/singlevm\n"
     printf "./setup.sh\n"
   path: /etc/update-motd.d/10-ciao-help-text
   permissions: '0755'
 - content: |
     deb https://apt.dockerproject.org/repo ubuntu-xenial main
   path: /etc/apt/sources.list.d/docker.list

runcmd:
 - echo "127.0.0.1 singlevm" >> /etc/hosts
 - mount hostgo
 - rm /etc/update-motd.d/10-help-text /etc/update-motd.d/51-cloudguest
{'fraction_non_alphanumeric': 0.18663761801016704, 'fraction_numerical': 0.02178649237472767, 'mean_word_length': 3.2466598150051387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2340420', 'n_tokens_mistral': 1511, 'n_tokens_neox': 1464, 'n_words': 389}