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

WIP: adding .sharingio/init #4234

Closed
wants to merge 13 commits into from
Closed

WIP: adding .sharingio/init #4234

wants to merge 13 commits into from

Conversation

hh
Copy link

@hh hh commented Sep 27, 2022

Do Not Merge: Mainly for discussion about bringing up a space to work on coder

See : sharingio#6

CODER_URL=https://coder.${SHARINGIO_PAIR_BASE_DNS_NAME}
# export vars to we can emulate a tty with a short expect script
export CODER_EMAIL CODER_PASSWORD CODER_USERNAME
coder login $CODER_URL -u $CODER_USERNAME -p $CODER_PASSWORD -e $CODER_EMAIL
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coder login -u $CODER_USERNAME is required to avoid the tty check.

https://github.com/coder/coder/blob/main/cli/login.go#L91-L94

if username == "" {
	if !isTTY(cmd) {
		return xerrors.New("the initial user cannot be created in non-interactive mode. use the API")
}

export CODER_EMAIL CODER_PASSWORD CODER_USERNAME
coder login $CODER_URL -u $CODER_USERNAME -p $CODER_PASSWORD -e $CODER_EMAIL

# TODO : upload / update the kubernetes template
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently unable to push / create or update templates due to 403 error:

+ kubectl rollout status deployment coder -n coder
Waiting for deployment "coder" rollout to finish: 0 of 1 updated replicas are available...
deployment "coder" successfully rolled out
+ kubectl wait -n coder --for=condition=ready pod -l app.kubernetes.io/name=coder
pod/coder-865b875674-n9sh5 condition met
+ [email protected]
+ CODER_PASSWORD=ii
+ CODER_USERNAME=ii
+ CODER_URL=https://coder.pair.pair.sharing.io
+ export CODER_EMAIL CODER_PASSWORD CODER_USERNAME
+ coder login https://coder.pair.pair.sharing.io -u ii -p ii -e [email protected]
> Your Coder deployment hasn't been set up!
                                                            
  Welcome to Coder, ii! You're authenticated.               
                                                            
  Get started by creating a template:  coder templates init 
ii@pair:~/sharingio/coder$ coder templates list
NAME        LAST UPDATED        USED BY              
kubernetes  September 28, 2022  - active developers  
ii@pair:~/sharingio/coder$ coder templates push kubernetes -d examples/templates/kubernetes -v -y
⧗  Queued 
.                                           
logs: unexpected status code 403:           
Run 'coder templates push --help' for usage.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both make and go run still seem to be missing something:

ii@pair:~/sharingio/coder$ make build/coder-slim_linux_amd64
ii@pair:~/sharingio/coder$ go run ./cmd/coder
# sort
/usr/local/go/src/sort/zsortfunc.go:10:6: insertionSort_func redeclared in this block
        /usr/local/go/src/sort/zfuncversion.go:10:6: other declaration of insertionSort_func
/usr/local/go/src/sort/zsortfunc.go:20:6: siftDown_func redeclared in this block
        /usr/local/go/src/sort/zfuncversion.go:19:6: other declaration of siftDown_func
/usr/local/go/src/sort/zsortfunc.go:38:6: heapSort_func redeclared in this block
        /usr/local/go/src/sort/zfuncversion.go:38:6: other declaration of heapSort_func
/usr/local/go/src/sort/zsortfunc.go:329:6: swapRange_func redeclared in this block
        /usr/local/go/src/sort/zfuncversion.go:65:6: other declaration of swapRange_func
/usr/local/go/src/sort/zsortfunc.go:335:6: stable_func redeclared in this block
        /usr/local/go/src/sort/zfuncversion.go:163:6: other declaration of stable_func
/usr/local/go/src/sort/zsortfunc.go:378:6: symMerge_func redeclared in this block
        /usr/local/go/src/sort/zfuncversion.go:187:6: other declaration of symMerge_func
/usr/local/go/src/sort/zsortfunc.go:464:6: rotate_func redeclared in this block
        /usr/local/go/src/sort/zfuncversion.go:252:6: other declaration of rotate_func

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The go issues were resolved by rm -rf /usr/local/go before upgrading golang.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go 1.19.1 was directly installed over top of Go 1.18.3 and caused this issue.

A quick fix was

sudo rm -rf /usr/local/go/
. /usr/lib/sharingio/environment/helper.sh
curl -L https://dl.google.com/go/go1.19.1.linux-${ARCH_TYPE_2}.tar.gz     | tar --directory /usr/local --extract --ungzip

sharingio/environment was updated to include Go 1.19.1

The line causing the issue was
https://github.com/sharingio/coder/blob/1a899ab/.sharing.io/init#L5

@github-actions
Copy link

github-actions bot commented Oct 8, 2022

This Pull Request is becoming stale. In order to minimize WIP, prevent merge conflicts and keep the tracker readable, I'm going close to this PR in 3 days if there isn't more activity.

@github-actions github-actions bot added the stale This issue is like stale bread. label Oct 8, 2022
@github-actions github-actions bot closed this Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue is like stale bread.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants